Skip to content

Commit

Permalink
fix: Get fresh RM rate in calculate_rm_cost
Browse files Browse the repository at this point in the history
  • Loading branch information
marination committed May 19, 2022
1 parent 9a7e9d9 commit dd99c00
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions erpnext/manufacturing/doctype/bom/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,18 @@ def calculate_rm_cost(self, save=False):
base_total_rm_cost = 0

for d in self.get("items"):
d.rate = self.get_rm_rate(
{
"company": self.company,
"item_code": d.item_code,
"bom_no": d.bom_no,
"qty": d.qty,
"uom": d.uom,
"stock_uom": d.stock_uom,
"conversion_factor": d.conversion_factor,
"sourced_by_supplier": d.sourced_by_supplier,
}
)
d.base_rate = flt(d.rate) * flt(self.conversion_rate)
d.amount = flt(d.rate, d.precision("rate")) * flt(d.qty, d.precision("qty"))
d.base_amount = d.amount * flt(self.conversion_rate)
Expand Down

0 comments on commit dd99c00

Please sign in to comment.