fix: Handle empty child table
This commit is contained in:
parent
8a30cb2565
commit
b7f6878222
@ -1897,8 +1897,8 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
autofill_warehouse : function (child_table, warehouse_field, warehouse) {
|
autofill_warehouse : function (child_table, warehouse_field, warehouse) {
|
||||||
let doctype = child_table[0].doctype;
|
if (warehouse && child_table && child_table.length) {
|
||||||
if (warehouse) {
|
let doctype = child_table[0].doctype;
|
||||||
$.each(child_table || [], function(i, item) {
|
$.each(child_table || [], function(i, item) {
|
||||||
frappe.model.set_value(doctype, item.name, warehouse_field, warehouse);
|
frappe.model.set_value(doctype, item.name, warehouse_field, warehouse);
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user