fix: only update items if rate or qty changed (#20742)

This commit is contained in:
Saqib 2020-02-27 12:51:31 +05:30 committed by GitHub
parent d40a5d92c2
commit dd374ff77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1200,6 +1200,8 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
child_item = set_purchase_order_defaults(parent_doctype, parent_doctype_name, child_docname, d.get("item_code"))
else:
child_item = frappe.get_doc(parent_doctype + ' Item', d.get("docname"))
if flt(child_item.get("rate")) == flt(d.get("rate")) and flt(child_item.get("qty")) == flt(d.get("qty")):
continue
if parent_doctype == "Sales Order" and flt(d.get("qty")) < flt(child_item.delivered_qty):
frappe.throw(_("Cannot set quantity less than delivered quantity"))