Validation while updating items in sales order
This commit is contained in:
parent
1fa3f7d81e
commit
ffb411d9e2
@ -1073,6 +1073,10 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name):
|
||||
data = json.loads(trans_items)
|
||||
for d in data:
|
||||
child_item = frappe.get_doc(parent_doctype + ' Item', d.get("docname"))
|
||||
|
||||
if flt(d.get("qty")) < child_item.delivered_qty:
|
||||
frappe.throw(_("Cannot set quantity less than delivered quantity"))
|
||||
|
||||
child_item.qty = flt(d.get("qty"))
|
||||
|
||||
if child_item.billed_amt > (flt(d.get("rate")) * flt(d.get("qty"))):
|
||||
|
Loading…
x
Reference in New Issue
Block a user