[enhance] automatic batch creation, move and split

This commit is contained in:
Rushabh Mehta
2017-04-20 15:21:01 +05:30
committed by Nabin Hait
parent bb2670d57a
commit e385b5b97b
21 changed files with 2631 additions and 2022 deletions

View File

@@ -143,6 +143,7 @@ def validate_uom_is_integer(doc, uom_field, qty_fields, child_dt=None):
for d in doc.get_all_children(parenttype=child_dt):
if d.get(uom_field) in integer_uoms:
for f in qty_fields:
if d.get(f):
if cint(d.get(f))!=d.get(f):
frappe.throw(_("Quantity cannot be a fraction in row {0}").format(d.idx), UOMMustBeIntegerError)
qty = d.get(f)
if qty:
if abs(int(qty) - float(qty)) > 0.0000001:
frappe.throw(_("Quantity ({0}) cannot be a fraction in row {1}").format(qty, d.idx), UOMMustBeIntegerError)