mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-16 21:35:09 +00:00
fix: None type error if the Pricing Rule applicable_for is None (#23664)
* fix: None type error if the Pricing Rule applicable_for is None * fix: sider Co-authored-by: Nabin Hait <nabinhait@gmail.com> Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
This commit is contained in:
@@ -49,9 +49,10 @@ class PricingRule(Document):
|
||||
if self.apply_on == apply_on and len(self.get(field) or []) < 1:
|
||||
throw(_("{0} is not added in the table").format(apply_on), frappe.MandatoryError)
|
||||
|
||||
tocheck = frappe.scrub(self.get("applicable_for", ""))
|
||||
if tocheck and not self.get(tocheck):
|
||||
throw(_("{0} is required").format(self.meta.get_label(tocheck)), frappe.MandatoryError)
|
||||
if self.get("applicable_for", "") is not None:
|
||||
tocheck = frappe.scrub(self.get("applicable_for", ""))
|
||||
if tocheck and not self.get(tocheck):
|
||||
throw(_("{0} is required").format(self.meta.get_label(tocheck)), frappe.MandatoryError)
|
||||
|
||||
if self.apply_rule_on_other:
|
||||
o_field = 'other_' + frappe.scrub(self.apply_rule_on_other)
|
||||
|
||||
Reference in New Issue
Block a user