diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 2a0bd58ceeb..400bd6e5626 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -5,7 +5,7 @@ import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import comma_or, flt, get_link_to_form, getdate, now, nowdate +from frappe.utils import comma_or, flt, get_link_to_form, getdate, now, nowdate, safe_div class OverAllowanceError(frappe.ValidationError): @@ -616,7 +616,7 @@ class StatusUpdater(Document): )[0][0] ) - per_billed = (min(ref_doc_qty, billed_qty) / ref_doc_qty) * 100 + per_billed = safe_div(min(ref_doc_qty, billed_qty), ref_doc_qty) * 100 ref_doc = frappe.get_doc(ref_dt, ref_dn)