fix(ux): set entries qty to 1
before making the field read-only
This commit is contained in:
parent
1d904c0a86
commit
1f28ca717e
@ -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
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user