← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 651426] Re: [6.0][account] user can't validate the invoice of an other company; patch included

 

** Branch linked: lp:~openerp-dev/openobject-addons/trunk-dev-addons3

-- 
[6.0][account] user can't validate the invoice of an other company; patch included
https://bugs.launchpad.net/bugs/651426
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: In Progress

Bug description:
Hello,

using last trunk addons rev #5030, suppose you create two charts of account properly for two different companies (may be fix https://bugs.launchpad.net/openobject-addons/+bug/651421) first.

Then, using the admin user from OpenERP S.A., create an invoice for Shop 1 (I did it through a new sale order).
Make sure to parameter the customer account properly (in Shop 1) and select an appropriate period (related to Shop 1).
Actually the invoice could be made by a user belonging to Shop 1, that would just makes it easier in general.

But, the point is, once this invoice is properly created for Shop 1, no OpenERP S.A. user can properly validate this invoice. I think this would however be a classical workflow where a single accountant will manage the invoices of two companies.

Currently, when admin will try to validate the invoice, the created account.move.line will try to have their company_id to OpenERP S.A. instead of Shop 1. Consequently, the account.move.line _check_company_id constraint will fail and the invoice can't be created.

I propose the following attached patch that fixes the issues: if the account move line belongs to some move that have a company_id set, then it will use that company_id. In our case, the move is created properly for Shop 1, so applying the patch makes the account move line use Shop 1 too and the invoice to validate properly.

Hope this helps.