Merge pull request #48773 from ShreyasTheNewbie/create_job_card

fix: create job card for selected operations only
This commit is contained in:
rohitwaghchaure
2025-07-25 10:05:36 +05:30
committed by GitHub

View File

@@ -349,13 +349,18 @@ frappe.ui.form.on("Work Order", {
return operations_data;
},
},
function (data) {
function () {
const selected_rows = dialog.fields_dict["operations"].grid.get_selected_children();
if (selected_rows.length == 0) {
frappe.msgprint(__("Please select atleast one operation to create Job Card"));
return;
}
frappe.call({
method: "erpnext.manufacturing.doctype.work_order.work_order.make_job_card",
freeze: true,
args: {
work_order: frm.doc.name,
operations: data.operations,
operations: selected_rows,
},
callback: function () {
frm.reload_doc();
@@ -366,7 +371,7 @@ frappe.ui.form.on("Work Order", {
__("Create")
);
dialog.fields_dict["operations"].grid.wrapper.find(".grid-add-row").hide();
dialog.fields_dict["operations"].grid.grid_buttons.hide();
var pending_qty = 0;
frm.doc.operations.forEach((data) => {