[FIX] warning: onchange_partner_id

The function _onchange_partner_id must be triggered when the field 'company_id'
is modified like with function _onchange_partner_id in addons/account/models/account_invoice.py
In this way, the account_id is set in 'account.invoice when the 'company_id' is changed.

opw:652918
This commit is contained in:
Goffin Simon
2015-10-29 15:58:44 +01:00
parent 87a3fe92de
commit 0366ae16a9
+1 -1
View File
@@ -108,7 +108,7 @@ class purchase_order(osv.Model):
class account_invoice(osv.osv):
_inherit = 'account.invoice'
@api.onchange('partner_id')
@api.onchange('partner_id', 'company_id')
def _onchange_partner_id(self):
result = super(account_invoice, self)._onchange_partner_id()
partner = self.partner_id