refactor: set 'cannot_add_rows' directly in the allocations table field (optimized approach)

This commit is contained in:
UmakanthKaspa
2024-11-15 05:43:25 +00:00
parent f908112935
commit 5dd8eafdfc

View File

@@ -100,6 +100,7 @@ erpnext.accounts.unreconcile_payment = {
fieldtype: "Table", fieldtype: "Table",
read_only: 1, read_only: 1,
fields: child_table_fields, fields: child_table_fields,
cannot_add_rows: true,
}, },
]; ];
@@ -119,14 +120,6 @@ erpnext.accounts.unreconcile_payment = {
return r.message; return r.message;
}; };
const allocationsTableField = unreconcile_dialog_fields.find(
(field) => field.fieldname === "allocations"
);
if (allocationsTableField) {
allocationsTableField.cannot_add_rows = true;
}
let d = new frappe.ui.Dialog({ let d = new frappe.ui.Dialog({
title: "UnReconcile Allocations", title: "UnReconcile Allocations",
fields: unreconcile_dialog_fields, fields: unreconcile_dialog_fields,