mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 06:28:29 +00:00
fix: fail silently
This commit is contained in:
@@ -37,7 +37,14 @@ def validate_regional(doc):
|
|||||||
|
|
||||||
for field in required_fields:
|
for field in required_fields:
|
||||||
condition = field.get("condition")
|
condition = field.get("condition")
|
||||||
if condition and not frappe.safe_eval(condition, doc.as_dict()):
|
condition_true = True
|
||||||
|
try:
|
||||||
|
condition_true = frappe.safe_eval(condition, doc.as_dict())
|
||||||
|
except:
|
||||||
|
# invalid condition should not result in an error
|
||||||
|
pass
|
||||||
|
|
||||||
|
if condition and not condition_true:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
field_name = field.get("field_name")
|
field_name = field.get("field_name")
|
||||||
|
|||||||
Reference in New Issue
Block a user