From 9f6bfabdeae797182da88031354dd180a39b609d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 23 Jan 2022 12:54:56 +0100 Subject: [PATCH] Ensure to set correct company context when calling today issue11046 review370421002 --- product.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index 121abc1f9f..a5075f174f 100644 --- a/product.py +++ b/product.py @@ -10,12 +10,14 @@ class Product(metaclass=PoolMeta): def _get_sale_unit_price(self, quantity=0): pool = Pool() + Date = pool.get('ir.date') PriceList = pool.get('product.price_list') Party = pool.get('party.party') Uom = pool.get('product.uom') Tax = pool.get('account.tax') User = pool.get('res.user') context = Transaction().context + today = Date.today() unit_price = super()._get_sale_unit_price(quantity=quantity) @@ -38,7 +40,8 @@ class Product(metaclass=PoolMeta): unit_price = price_list.compute( customer, self, unit_price, quantity, uom) if price_list.tax_included and taxes and unit_price is not None: - unit_price = Tax.reverse_compute(unit_price, taxes) + unit_price = Tax.reverse_compute( + unit_price, taxes, today) return unit_price