fix: discard empty rows from update items (#27021)

This commit is contained in:
Ankush Menat 2021-08-24 12:18:40 +05:30 committed by GitHub
parent 0dff0beaba
commit 6de7b8ea93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1836,6 +1836,11 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
for d in data:
new_child_flag = False
if not d.get("item_code"):
# ignore empty rows
continue
if not d.get("docname"):
new_child_flag = True
check_doc_permissions(parent, 'create')

View File

@ -563,7 +563,7 @@ erpnext.utils.update_child_items = function(opts) {
},
],
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({
method: 'erpnext.controllers.accounts_controller.update_child_qty_rate',
freeze: true,