summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2020-01-07 17:17:36 +0000
committerVictor Feyens <vfe@odoo.com>2020-01-09 10:04:32 +0000
commit2691c66dbc56c94c4cd47c8ccafa7e7c6921c2e1 (patch)
tree8ed3212b86e957e65fd0fdb8da9deac820f66fd4
parent0cbd941d442387288494531b096eba3947b6e284 (diff)
[FIX] account: use the right company to access partner properties.
closes odoo/odoo#42955 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
-rw-r--r--addons/account/models/account_move.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 0633511b86d..5e58e89984b 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -286,6 +286,7 @@ class AccountMove(models.Model):
@api.onchange('partner_id')
def _onchange_partner_id(self):
+ self = self.with_company(self.company_id)
warning = {}
if self.partner_id:
rec_account = self.partner_id.property_account_receivable_id
@@ -320,7 +321,7 @@ class AccountMove(models.Model):
# Find the new fiscal position.
delivery_partner_id = self._get_invoice_delivery_partner_id()
- self.fiscal_position_id = self.env['account.fiscal.position'].with_company(self.company_id).get_fiscal_position(
+ self.fiscal_position_id = self.env['account.fiscal.position'].get_fiscal_position(
self.partner_id.id, delivery_id=delivery_partner_id)
self._recompute_dynamic_lines()
if warning: