changeset 05d20a707786 in modules/product_price_list:default
details:
https://hg.tryton.org/modules/product_price_list?cmd=changeset;node=05d20a707786
description:
Do not fail to compute price without product
The tests of product_price_list_dates call compute without product.
diffstat:
price_list.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r 359249a9315b -r 05d20a707786 price_list.py
--- a/price_list.py Sat Sep 28 23:59:09 2019 +0200
+++ b/price_list.py Sun Sep 29 12:13:49 2019 +0200
@@ -53,7 +53,10 @@
def get_context_formula(self, party, product, unit_price, quantity, uom,
pattern=None):
- cost_price = product.get_multivalue('cost_price') or Decimal('0')
+ if product:
+ cost_price = product.get_multivalue('cost_price') or Decimal('0')
+ else:
+ cost_price = Decimal('0')
return {
'names': {
'unit_price': unit_price,