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

Bug #651426 reported by Raphaël Valyi - http://www.akretion.com
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

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.

Related branches

Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :
summary: - [6.0][account] user can't validate the invoice of an other company
+ [6.0][account] user can't validate the invoice of an other company;
+ patch included
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
milestone: 6.0 → 6.0-rc2
Revision history for this message
Priyesh (OpenERP) (pso-openerp) wrote :

Hello Raphaël Valyi,

We have applied your patch in Addons3 branch.

revision-id: mra@mra-laptop-20101102093337-0diiqe2wmapc68i2
revno: 4567

Thanks for your contribution.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.