Skip to content

Commit

Permalink
fix: Default dimensions on fetching items from BOM (backport #33439) (#…
Browse files Browse the repository at this point in the history
…33459)

fix: Default dimensions on fetching items from BOM (#33439)

(cherry picked from commit 0b75aa5)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
  • Loading branch information
mergify[bot] and deepeshgarg007 authored Dec 27, 2022
1 parent a166a76 commit a332b22
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions erpnext/stock/doctype/stock_entry/stock_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ frappe.ui.form.on('Stock Entry', {
}
});
attach_bom_items(frm.doc.bom_no);

if(!check_should_not_attach_bom_items(frm.doc.bom_no)) {
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
}
},

setup_quality_inspection: function(frm) {
Expand Down Expand Up @@ -326,7 +330,11 @@ frappe.ui.form.on('Stock Entry', {
}

frm.trigger("setup_quality_inspection");
attach_bom_items(frm.doc.bom_no)
attach_bom_items(frm.doc.bom_no);

if(!check_should_not_attach_bom_items(frm.doc.bom_no)) {
erpnext.accounts.dimensions.update_dimension(frm, frm.doctype);
}
},

before_save: function(frm) {
Expand Down Expand Up @@ -939,7 +947,10 @@ erpnext.stock.StockEntry = class StockEntry extends erpnext.stock.StockControlle
method: "get_items",
callback: function(r) {
if(!r.exc) refresh_field("items");
if(me.frm.doc.bom_no) attach_bom_items(me.frm.doc.bom_no)
if(me.frm.doc.bom_no) {
attach_bom_items(me.frm.doc.bom_no);
erpnext.accounts.dimensions.update_dimension(me.frm, me.frm.doctype);
}
}
});
}
Expand Down

0 comments on commit a332b22

Please sign in to comment.