Skip to content

Commit

Permalink
fix: Call calculate_cost for Draft BOM and typo in argument
Browse files Browse the repository at this point in the history
  • Loading branch information
marination committed May 20, 2022
1 parent cbc52a2 commit d035aa2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ def update_cost(self, update_parent=True, from_child_bom=False, update_hour_rate

if self.docstatus == 1:
self.flags.ignore_validate_update_after_submit = True
self.calculate_cost(save_updates=save, update_hour_rate=update_hour_rate)

self.calculate_cost(save_updates=save, update_hour_rate=update_hour_rate)

if save:
self.db_update()

Expand Down Expand Up @@ -577,11 +579,11 @@ def _get_children(bom_no):
bom_list.reverse()
return bom_list

def calculate_cost(self, save_update=False, update_hour_rate=False):
def calculate_cost(self, save_updates=False, update_hour_rate=False):
"""Calculate bom totals"""
self.calculate_op_cost(update_hour_rate)
self.calculate_rm_cost(save=save_update)
self.calculate_sm_cost(save=save_update)
self.calculate_rm_cost(save=save_updates)
self.calculate_sm_cost(save=save_updates)
self.total_cost = self.operating_cost + self.raw_material_cost - self.scrap_material_cost
self.base_total_cost = (
self.base_operating_cost + self.base_raw_material_cost - self.base_scrap_material_cost
Expand Down

0 comments on commit d035aa2

Please sign in to comment.