openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #00767
[Bug 810548] Re: multi-company invoice validation error
still incorrect, i reopen the bug
** Changed in: openobject-addons
Status: Fix Committed => Confirmed
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/810548
Title:
multi-company invoice validation error
Status in OpenERP Addons (modules):
Confirmed
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