Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Zero division error while making finished good entry against the… #20375

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion erpnext/stock/doctype/stock_entry/stock_entry.py
Expand Up @@ -484,7 +484,7 @@ def set_basic_rate_for_finished_goods(self, raw_material_cost, scrap_material_co
if self.work_order \
and frappe.db.get_single_value("Manufacturing Settings", "material_consumption"):
bom_items = self.get_bom_raw_materials(d.transfer_qty)
raw_material_cost = sum([flt(d.qty)*flt(d.rate) for d in bom_items.values()])
raw_material_cost = sum([flt(row.qty)*flt(row.rate) for row in bom_items.values()])

if raw_material_cost:
d.basic_rate = flt((raw_material_cost - scrap_material_cost) / flt(d.transfer_qty), d.precision("basic_rate"))
Expand Down