product_price_list_dates: add date in pattern to match price list

#050574
This commit is contained in:
Raimon Esteve 2022-04-04 11:39:51 +02:00 committed by GitHub
parent 08fa33301f
commit 009c3c149f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

30
issue11359.diff Normal file
View File

@ -0,0 +1,30 @@
diff --git a/trytond/trytond/modules/product_price_list_dates/product.py b/trytond/trytond/modules/product_price_list_dates/product.py
index 003742f..e66b4bf 100644
--- a/trytond/trytond/modules/product_price_list_dates/product.py
+++ b/trytond/trytond/modules/product_price_list_dates/product.py
@@ -3,6 +3,7 @@
from trytond.model import ModelView, fields
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval, If
+from trytond.transaction import Transaction
class PriceList(metaclass=PoolMeta):
@@ -21,6 +22,17 @@ class PriceList(metaclass=PoolMeta):
def open_lines(cls, price_lists):
pass
+ def compute(self, party, product, unit_price, quantity, uom,
+ pattern=None):
+ context = Transaction().context
+ if pattern is None:
+ pattern = {}
+ pattern = pattern.copy()
+ if not pattern.get('date') and context.get('date'):
+ pattern['date'] = context['date']
+ return super(PriceList, self).compute(party, product, unit_price,
+ quantity, uom, pattern)
+
class PriceListLine(metaclass=PoolMeta):
__name__ = 'product.price_list.line'

1
series
View File

@ -57,3 +57,4 @@ statement_of_account.diff # [account] Cumulate balance of previous fiscal years
statement_of_account_2.diff # [account] Use from_date and to_date from context in _debit_credit_context() (pending core)
issue11306.diff # [analytic_invocie] Add compatibility between the analytic_invocie module and the account_invoice_defer module (only 6.0)
issue11359.diff # [product_price_list_dates] add date in pattern to match price list