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