fix: discard empty rows from update items (#27021)
This commit is contained in:
parent
0dff0beaba
commit
6de7b8ea93
@ -1836,6 +1836,11 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
|
|||||||
|
|
||||||
for d in data:
|
for d in data:
|
||||||
new_child_flag = False
|
new_child_flag = False
|
||||||
|
|
||||||
|
if not d.get("item_code"):
|
||||||
|
# ignore empty rows
|
||||||
|
continue
|
||||||
|
|
||||||
if not d.get("docname"):
|
if not d.get("docname"):
|
||||||
new_child_flag = True
|
new_child_flag = True
|
||||||
check_doc_permissions(parent, 'create')
|
check_doc_permissions(parent, 'create')
|
||||||
|
@ -563,7 +563,7 @@ erpnext.utils.update_child_items = function(opts) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
primary_action: function() {
|
primary_action: function() {
|
||||||
const trans_items = this.get_values()["trans_items"];
|
const trans_items = this.get_values()["trans_items"].filter((item) => !!item.item_code);
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: 'erpnext.controllers.accounts_controller.update_child_qty_rate',
|
method: 'erpnext.controllers.accounts_controller.update_child_qty_rate',
|
||||||
freeze: true,
|
freeze: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user