fix: eval fail message fix

This commit is contained in:
Abhishek Balam 2020-08-13 12:13:08 +05:30
parent ca898c6da3
commit 487aa30aef

View File

@ -150,7 +150,7 @@ def validate_condition(pricing_rule, doc=None):
doc = doc.as_dict()
return frappe.safe_eval(pricing_rule.condition, None, doc)
except Exception as e:
frappe.throw(doc.name + " Pricing Rule 'Condition' field error:<br>" + str(e).capitalize() )
frappe.throw(" Pricing Rule - " + pricing_rule.name + " - 'Condition' field error:<br>" + str(e).capitalize() )
return False
return True
#--------------------------------------------------------------------------------