Skip to content

Commit

Permalink
fix: item not coming in quick entry
Browse files Browse the repository at this point in the history
(cherry picked from commit dcbb54c)
  • Loading branch information
rohitwaghchaure authored and mergify[bot] committed Mar 26, 2024
1 parent 634054c commit 008894d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry.js
Expand Up @@ -408,12 +408,26 @@ frappe.ui.form.on("Stock Entry", {
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");
if (sbb_field) {
sbb_field.get_route_options_for_new_doc = (row) => {
return {
item_code: row.doc.item_code,
voucher_type: frm.doc.doctype,
warehouse: row.doc.s_warehouse || row.doc.t_warehouse,
};
};
}
Expand Down

0 comments on commit 008894d

Please sign in to comment.