From 6ccfa8660e1f0fe4e224eddc6302fe8e3c2f95ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 27 Aug 2021 08:46:28 +0200 Subject: [PATCH] Restore instance context when getting price list used The price_list_used is set on property so it is executed under the transaction context but we expect to have the price list from the company set in the instance context. issue10664 review369491002 --- product.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index 06ae725844..85c516089f 100644 --- a/product.py +++ b/product.py @@ -589,7 +589,10 @@ class Product( @property def list_price_used(self): - return self.template.get_multivalue('list_price') + transaction = Transaction() + with transaction.reset_context(), \ + transaction.set_context(self._context): + return self.template.get_multivalue('list_price') @classmethod def sync_code(cls, products):