Wrong organization (ad_org_id=* instead of real organization) in matched PO document when reversing MR with invoice under the following conditions:
Costing Method=Average PO
1. Create Purchase Order for a product in org=A, qty=10
2. Create MR, qty=10, org=A
2.1 =>Creates a Matched PO with org=A =>OK
3. Create Vendor Invoice, qty=10, org=A
3.1 =>The matched PO document in step2 is updated with the invoice line =>OK
4. Reverse/Correct MR.
4.1 =>Creates a matched PO reversal document with org=A =>OK
4.2 =>Creates a new matched PO document with matched vendor invoice and with the same M_PO documentNo as in 2 (with new m_matchpo_id) but with org=* => NOT OK
5. Because the matched PO document in 4.2 is assinged to org=*, the document can't be posted =>NOT OK
6. PO OnOrder qty=10 but PO qty delivered is now -10 =>NOT OK
7. An attempt to post a new MR fails with Database Error.: DBExecuteError:ERROR: null value in column "c_invoiceline_id" violates not-null constraint
Screenshot of the matched PO situation is attached.