diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index c86e3f61e5..77b52b18f8 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -65,7 +65,7 @@ class PricingRule(Document): def validate_max_discount(self): if self.price_or_discount == "Discount Percentage" and self.item_code: max_discount = frappe.db.get_value("Item", self.item_code, "max_discount") - if flt(self.discount_percentage) > max_discount: + if max_discount and flt(self.discount_percentage) > flt(max_discount): throw(_("Max discount allowed for item: {0} is {1}%".format(self.item_code, max_discount)))