fix: item not coming in quick entry
This commit is contained in:
@@ -408,12 +408,26 @@ frappe.ui.form.on("Stock Entry", {
|
|||||||
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frm.events.set_route_options_for_new_doc(frm);
|
||||||
|
},
|
||||||
|
|
||||||
|
set_route_options_for_new_doc(frm) {
|
||||||
|
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) {
|
||||||
|
return {
|
||||||
|
item: row.doc.item_code,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
let sbb_field = frm.get_docfield("items", "serial_and_batch_bundle");
|
let sbb_field = frm.get_docfield("items", "serial_and_batch_bundle");
|
||||||
if (sbb_field) {
|
if (sbb_field) {
|
||||||
sbb_field.get_route_options_for_new_doc = (row) => {
|
sbb_field.get_route_options_for_new_doc = (row) => {
|
||||||
return {
|
return {
|
||||||
item_code: row.doc.item_code,
|
item_code: row.doc.item_code,
|
||||||
voucher_type: frm.doc.doctype,
|
voucher_type: frm.doc.doctype,
|
||||||
|
warehouse: row.doc.s_warehouse || row.doc.t_warehouse,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user