From 2512962f55e355be4e17ff6ea53efe91c89d921d Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 28 Nov 2019 16:46:58 +0530 Subject: [PATCH] fix: handle None case for get_shipping_amount_from_rules (#19723) --- erpnext/accounts/doctype/shipping_rule/shipping_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index a20f5c0872..8c4efbebe8 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -70,7 +70,7 @@ class ShippingRule(Document): def get_shipping_amount_from_rules(self, value): for condition in self.get("conditions"): - if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)): + if not condition.to_value or (flt(condition.from_value) <= flt(value) <= flt(condition.to_value)): return condition.shipping_amount return 0.0