From e6d790e3408f7f5a8eab4bbf05c06fc92b779cc1 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 9 Mar 2017 13:31:49 +0100 Subject: [PATCH] [FIX] account: _onchange_partner_id not matching fiscal position When changing partner_id on an invoice, the fiscal positions with auto_apply=True, must be checked to apply the right one. To have the same behavior as in 10.0 Backport of this commit: 4b11e3e3a5f42fe1842b0b7405cac4908ee2dd97 opw:715511 --- addons/account/models/account_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 917f17e9950..044e5b8d85b 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -488,7 +488,8 @@ class AccountInvoice(models.Model): else: account_id = pay_account.id payment_term_id = p.property_supplier_payment_term_id.id - fiscal_position = p.property_account_position_id.id + addr = p.address_get(['delivery']) + fiscal_position = self.env['account.fiscal.position'].get_fiscal_position(p.id, delivery_id=addr['delivery']) self.account_id = account_id self.payment_term_id = payment_term_id