Skip to content

Commit

Permalink
fix(ux): set route options for new Batch
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Jun 16, 2023
1 parent 9d1fac1 commit b261242
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
this.frm.set_query("batch_no", "items", function(doc, cdt, cdn) {
return me.set_query_for_batch(doc, cdt, cdn);
});

let batch_field = this.frm.get_docfield('items', 'batch_no');
if (batch_field) {
batch_field.get_route_options_for_new_doc = (row) => {
return {
'item': row.doc.item_code
}
};
}
}

if(
Expand Down
8 changes: 8 additions & 0 deletions erpnext/stock/doctype/stock_entry/stock_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ frappe.ui.form.on('Stock Entry', {
}
});

let batch_field = frm.get_docfield('items', 'batch_no');
if (batch_field) {
batch_field.get_route_options_for_new_doc = (row) => {
return {
'item': row.doc.item_code
}
};
}

frm.add_fetch("bom_no", "inspection_required", "inspection_required");
erpnext.accounts.dimensions.setup_dimension_filters(frm, frm.doctype);
Expand Down

0 comments on commit b261242

Please sign in to comment.