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

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

(cherry picked from commit a424310581)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.json

* fix: resolve conflict

Co-authored-by: Sagar Sharma <63660334+s-aga-r@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2021-11-12 14:41:00 +05:30
committed by GitHub
parent 4c99f7159d
commit 68ff68a357
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) {
frappe.flags.pause_job = 0;
frappe.flags.resume_job = 0;

View File

@@ -397,6 +397,7 @@
"options": "Batch"
},
{
"collapsible": 1,
"fieldname": "scrap_items_section",
"fieldtype": "Section Break",
"label": "Scrap Items"
@@ -419,7 +420,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2021-11-09 14:07:20.290306",
"modified": "2021-11-12 10:15:03.572401",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Job Card",