fix: Collapse Scrap Items in Job Card (#28362)

This commit is contained in:
Sagar Sharma 2021-11-12 13:50:30 +05:30 committed by GitHub
parent 829f92f10a
commit a424310581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -23,6 +23,12 @@ frappe.ui.form.on('Job Card', {
); );
}, },
onload: function(frm) {
if (frm.doc.scrap_items.length == 0) {
frm.fields_dict['scrap_items_section'].collapse();
}
},
refresh: function(frm) { refresh: function(frm) {
frappe.flags.pause_job = 0; frappe.flags.pause_job = 0;
frappe.flags.resume_job = 0; frappe.flags.resume_job = 0;

View File

@ -396,6 +396,7 @@
"options": "Batch" "options": "Batch"
}, },
{ {
"collapsible": 1,
"fieldname": "scrap_items_section", "fieldname": "scrap_items_section",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"label": "Scrap Items" "label": "Scrap Items"
@ -411,7 +412,7 @@
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2021-09-14 00:38:46.873105", "modified": "2021-11-12 10:15:03.572401",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Manufacturing", "module": "Manufacturing",
"name": "Job Card", "name": "Job Card",