fix(ux): set route options for new SBB
This commit is contained in:
parent
50f83859db
commit
4b5454c752
@ -112,6 +112,17 @@ erpnext.assets.AssetCapitalization = class AssetCapitalization extends erpnext.s
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
let sbb_field = me.frm.get_docfield('stock_items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'warehouse': row.doc.warehouse,
|
||||
'voucher_type': me.frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
target_item_code() {
|
||||
|
@ -40,6 +40,16 @@ frappe.ui.form.on('Asset Repair', {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('stock_items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
@ -23,6 +23,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,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
frm.set_indicator_formatter('sub_operation',
|
||||
function(doc) {
|
||||
if (doc.status == "Pending") {
|
||||
|
@ -134,6 +134,15 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = this.frm.get_docfield('items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if(
|
||||
|
@ -18,6 +18,16 @@ frappe.ui.form.on('Installation Note', {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
onload: function(frm) {
|
||||
if(!frm.doc.status) {
|
||||
|
@ -46,6 +46,17 @@ frappe.ui.form.on('Quotation', {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('packed_items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'warehouse': row.doc.warehouse,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
@ -65,6 +65,17 @@ frappe.ui.form.on('Pick List', {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('locations', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'warehouse': row.doc.warehouse,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
set_item_locations:(frm, save) => {
|
||||
if (!(frm.doc.locations && frm.doc.locations.length)) {
|
||||
|
@ -115,6 +115,15 @@ frappe.ui.form.on('Stock Entry', {
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
frm.add_fetch("bom_no", "inspection_required", "inspection_required");
|
||||
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
|
||||
|
@ -42,6 +42,17 @@ frappe.ui.form.on("Stock Reconciliation", {
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.item_code,
|
||||
'warehouse': row.doc.warehouse,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (frm.doc.company) {
|
||||
erpnext.queries.setup_queries(frm, "Warehouse", function() {
|
||||
return erpnext.queries.warehouse(frm.doc);
|
||||
|
@ -89,6 +89,16 @@ frappe.ui.form.on('Subcontracting Receipt', {
|
||||
}
|
||||
});
|
||||
|
||||
let sbb_field = frm.get_docfield('supplied_items', 'serial_and_batch_bundle');
|
||||
if (sbb_field) {
|
||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||
return {
|
||||
'item_code': row.doc.rm_item_code,
|
||||
'voucher_type': frm.doc.doctype,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let batch_no_field = frm.get_docfield('items', 'batch_no');
|
||||
if (batch_no_field) {
|
||||
batch_no_field.get_route_options_for_new_doc = function(row) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user