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
This commit is contained in:
Cédric Krier
2021-08-27 08:46:28 +02:00
parent e7f16e116d
commit 6ccfa8660e
+4 -1
View File
@@ -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):