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

fix: promotional scheme not able to save
This commit is contained in:
rohitwaghchaure 2020-05-16 11:34:23 +05:30 committed by GitHub
commit 7435174300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,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):