c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #29068
[Bug 810548] Re: multi-company invoice validation error
** Changed in: openobject-addons
Status: Confirmed => In Progress
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/810548
Title:
multi-company invoice validation error
Status in OpenERP Modules (addons):
In Progress
Bug description:
I try confirm invoice with admin user and another company. Then I get
error "Company must be same for its related account and period.".
Account and period are defined for same company.
After searching for a problem I find out that constrain
(_check_company_id) from the account_move_line have line:
"if l.company_id != l.account_id.company_id or l.company_id != l.period_id.company_id:" and field 'company_id': "
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account/account_move_line.py#L587
and saw that company_id field is related with account_id:
'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/head:/account/account_move_line.py#L517
So question is why it needs check when l.company_id must be same like
l.account_id.company_id, because it is related field?
For me problem is that company_id is not same like
l.account_id.company_id, but when I comment 587 line everything goes
okay and account move and account move lines are created for same
company which was in invoice. So I think it is problem with related
field which don't show good value when I want confirm invoice.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/810548/+subscriptions
References