mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-03 05:28:27 +00:00
fix(ux): set entries qty to 1 before making the field read-only
This commit is contained in:
@@ -127,6 +127,14 @@ frappe.ui.form.on('Serial and Batch Bundle', {
|
||||
},
|
||||
|
||||
toggle_fields(frm) {
|
||||
if (frm.doc.has_serial_no) {
|
||||
frm.doc.entries.forEach(row => {
|
||||
if (Math.abs(row.qty) !== 1) {
|
||||
frappe.model.set_value(row.doctype, row.name, "qty", 1);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
frm.fields_dict.entries.grid.update_docfield_property(
|
||||
'serial_no', 'read_only', !frm.doc.has_serial_no
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user