fix: consider qty field precision
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 21a0a55..d84e4c4 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -186,12 +186,15 @@
for f in qty_fields:
qty = d.get(f)
if qty:
- if abs(cint(qty) - flt(qty)) > 0.0000001:
+ if abs(cint(qty) - flt(qty, d.precision(f))) > 0.0000001:
frappe.throw(
_(
"Row {1}: Quantity ({0}) cannot be a fraction. To allow this, disable '{2}' in UOM {3}."
).format(
- qty, d.idx, frappe.bold(_("Must be Whole Number")), frappe.bold(d.get(uom_field))
+ flt(qty, d.precision(f)),
+ d.idx,
+ frappe.bold(_("Must be Whole Number")),
+ frappe.bold(d.get(uom_field)),
),
UOMMustBeIntegerError,
)