Skip to content

Commit

Permalink
fix: Skip empty rows while updating unsaved BOM cost (#28136)
Browse files Browse the repository at this point in the history
- Dont try to get valuation rate if row has no item code
- Dont try to add exploded items if row has no item code

(cherry picked from commit 292419b)
  • Loading branch information
marination authored and mergify-bot committed Oct 29, 2021
1 parent c822f28 commit 6c5cd8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ def update_cost(self, update_parent=True, from_child_bom=False, update_hour_rate
existing_bom_cost = self.total_cost

for d in self.get("items"):
if not d.item_code:
continue

rate = self.get_rm_rate({
"company": self.company,
"item_code": d.item_code,
Expand Down Expand Up @@ -600,7 +603,7 @@ def get_exploded_items(self):
for d in self.get('items'):
if d.bom_no:
self.get_child_exploded_items(d.bom_no, d.stock_qty)
else:
elif d.item_code:
self.add_to_cur_exploded_items(frappe._dict({
'item_code' : d.item_code,
'item_name' : d.item_name,
Expand Down

0 comments on commit 6c5cd8c

Please sign in to comment.