Merge pull request #21748 from rohitwaghchaure/fix-supplier-schema-save-issue-hotfix

fix: promotional scheme not able to save
This commit is contained in:
rohitwaghchaure
2020-05-16 11:34:33 +05:30
committed by GitHub

View File

@@ -103,7 +103,7 @@ class PricingRule(Document):
self.same_item = 1
def validate_max_discount(self):
if self.rate_or_discount == "Discount Percentage" and self.items:
if self.rate_or_discount == "Discount Percentage" and self.get("items"):
for d in self.items:
max_discount = frappe.get_cached_value("Item", d.item_code, "max_discount")
if max_discount and flt(self.discount_percentage) > flt(max_discount):