fix(ux): move get_route_options_for_new_doc to refresh (#37096)

fix: move `get_route_options_for_new_doc` to `refresh`
This commit is contained in:
HENRY Florian
2023-09-16 12:29:09 +02:00
committed by GitHub
parent fc016680c9
commit 34bb64e41a
8 changed files with 117 additions and 110 deletions

View File

@@ -23,17 +23,6 @@ frappe.ui.form.on('Job Card', {
}
});
let sbb_field = frm.get_docfield('serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = () => {
return {
'item_code': frm.doc.production_item,
'warehouse': frm.doc.wip_warehouse,
'voucher_type': frm.doc.doctype,
}
};
}
frm.set_indicator_formatter('sub_operation',
function(doc) {
if (doc.status == "Pending") {
@@ -124,6 +113,17 @@ frappe.ui.form.on('Job Card', {
}
});
}
let sbb_field = frm.get_docfield('serial_and_batch_bundle');
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = () => {
return {
'item_code': frm.doc.production_item,
'warehouse': frm.doc.wip_warehouse,
'voucher_type': frm.doc.doctype,
}
};
}
},
setup_quality_inspection: function(frm) {