Copy lines process doesn't handle org properly


steps to reproduce:
1. create invoice inv1 in orgA
2. create invoice inv2 in orgB
3. copy lines from invoice 1 orgA
4. idempiere copying lines to inv2/orgB with orgA - instead must set org B to orgB lines

awaited result must be:

L1 OrgA
L2 OrgA

L1 OrgB
L2 OrgB

otherwise wrong tax and accounting consequences.




Carlos Ruiz
October 7, 2015, 1:05 PM

Thanks , I see.

So, this ticket maybe is heading to a bigger issue, I'm wondering if we must make the organization on invoice line read-only - or if we must generate taxes split by organization.

Armen Rizal
October 15, 2015, 7:30 AM

I think the issue is valid. What user should expect when he/she copying is the same org as in the header. If needed, he/she can change the org in lines after copying.

The org on line should not be read only. There are cases that we need to distribute expenses into different child orgs.


Armen Rizal

Norbert Bede
October 15, 2015, 1:01 PM

summary from my perspective

1. copy wrong org patch is valid - possible to commit
2. readonly org is not possible implement - others using this for cost distribution
3. To keep and make it safer we should implement e.g. improve doctype by a field "change document line org" make it default NO. in my opinion most of companies not using cost distribution by (this could be another ticket)

Carlos Ruiz
October 15, 2015, 6:20 PM

, what do you think about the comment from
> After completing orgB invoice, invoice Tax was calculated to orgA instead orgB. this cause inconsistent data. We fixed it and working properly now.
If this is causing inconsistent invoice tax records or accounting postings - then we must fix them.

On the other hand:
I agree I would prefer to copy the org from the header, but as you can see in this recent thread
what some users expect can be different than other users - so, I guess in future we can find users saying - "why the org is not copied? I expected an exact copy of the invoice/credit note/whatever"

I'm not sure if is worthy to have a Sysconfig key for this, or just change this default behavior:

Another issue is that I find inconsistent behavior, if we fix this then MInvoice, MProject, MJournalBatch and MJournal must be fixed in the same way?
And funnily MInOut is copying org from header actually.



Carlos Ruiz

Armen Rizal
October 19, 2015, 4:50 AM

Hi ,
I'm not familiar with tax regulation in other country. In my experience alone, all invoice taxes should follow the Org of the header.

The other issue raised in recent thread, in fact, already hold the correct rule, that is "when we do copy, it doesn't mean we will have an exact copy because the system would try to validate what you copy against the current context."

This turned out to be viral. IMHO we should apply the same solution (whatever it is) for all for the sake of consistency.

Just my 2 cents,

Armen Rizal



Tomáš Švikruha


Norbert Bede


Tested By