fix: Price rule filtering in case of no doc
This commit is contained in:
parent
d9accededa
commit
1067f7ed3e
@ -145,7 +145,7 @@ class PricingRule(Document):
|
||||
|
||||
def validate_condition(self):
|
||||
if self.condition and ("=" in self.condition) and re.match("""[\w\.:_]+\s*={1}\s*[\w\.@'"]+""", self.condition):
|
||||
frappe.throw(_("Invalid condition in Pricing Rule - {0}").format(pricing_rule.name), frappe.ValidationError)
|
||||
frappe.throw(_("Invalid condition expression"))
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
|
@ -66,6 +66,8 @@ def filter_pricing_rule_based_on_condition(pricing_rules, doc=None):
|
||||
str(e).capitalize() + "<br><br>Ignoring Pricing Rule"), indicator="orange", title=_("Warning"))
|
||||
else:
|
||||
filtered_pricing_rules.append(pricing_rule)
|
||||
else:
|
||||
filtered_pricing_rules = pricing_rules
|
||||
|
||||
return filtered_pricing_rules
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user