mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-12 17:51:20 +00:00
fix: division in supplier score criteria throws zero division error
This commit is contained in:
@@ -45,7 +45,7 @@ class SupplierScorecardCriteria(Document):
|
|||||||
mylist = re.finditer(regex, test_formula, re.MULTILINE | re.DOTALL)
|
mylist = re.finditer(regex, test_formula, re.MULTILINE | re.DOTALL)
|
||||||
for _dummy1, match in enumerate(mylist):
|
for _dummy1, match in enumerate(mylist):
|
||||||
for _dummy2 in range(0, len(match.groups())):
|
for _dummy2 in range(0, len(match.groups())):
|
||||||
test_formula = test_formula.replace("{" + match.group(1) + "}", "0")
|
test_formula = test_formula.replace("{" + match.group(1) + "}", "1")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
frappe.safe_eval(test_formula, None, {"max": max, "min": min})
|
frappe.safe_eval(test_formula, None, {"max": max, "min": min})
|
||||||
|
|||||||
Reference in New Issue
Block a user