changeset 3796a0f48971 in modules/sale_shipment_cost:default
details:
https://hg.tryton.org/modules/sale_shipment_cost?cmd=changeset&node=3796a0f48971
description:
Support empty list price on product
issue10244
review350341002
diffstat:
sale.py | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (22 lines):
diff -r c910b270db7c -r 3796a0f48971 sale.py
--- a/sale.py Fri Aug 27 08:48:34 2021 +0200
+++ b/sale.py Mon Sep 13 23:29:57 2021 +0200
@@ -221,11 +221,13 @@
if self.carrier and stockable:
with Transaction().set_context(self._get_carrier_context()):
cost, currency_id = self.carrier.get_sale_price()
- today = Date.today()
- date = self.sale_date or today
- with Transaction().set_context(date=date):
- return Currency.compute(
- Currency(currency_id), cost, self.currency, round=False)
+ if cost is not None:
+ today = Date.today()
+ date = self.sale_date or today
+ with Transaction().set_context(date=date):
+ return Currency.compute(
+ Currency(currency_id),
+ cost, self.currency, round=False)
def set_shipment_cost(self):
cost = None