From 6e1a2b16a534ad342950f4ca2ea4e109e5f7b28f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 21 Feb 2017 13:11:02 +0530 Subject: [PATCH] Company, Currency, Conversion Rate fields are mandatory in BOM --- erpnext/manufacturing/doctype/bom/bom.json | 10 +++++----- erpnext/manufacturing/doctype/bom/bom.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index c2c9b642a5..7e4b7ea7f6 100644 --- a/erpnext/manufacturing/doctype/bom/bom.json +++ b/erpnext/manufacturing/doctype/bom/bom.json @@ -323,7 +323,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -378,7 +378,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -976,7 +976,7 @@ "read_only": 0, "remember_last_selected_value": 1, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -1271,8 +1271,8 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-11-21 17:06:49.349654", - "modified_by": "rohit@erpnext.com", + "modified": "2017-02-21 13:10:27.394012", + "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", "owner": "Administrator", diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index f4fed6e097..53398ea0ab 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -321,9 +321,9 @@ class BOM(Document): if d.bom_no: d.rate = self.get_bom_unitcost(d.bom_no) - d.base_rate = d.rate * self.conversion_rate + d.base_rate = flt(d.rate) * flt(self.conversion_rate) d.amount = flt(d.rate, self.precision("rate", d)) * flt(d.qty, self.precision("qty", d)) - d.base_amount = d.amount * self.conversion_rate + d.base_amount = d.amount * flt(self.conversion_rate) d.qty_consumed_per_unit = flt(d.qty, self.precision("qty", d)) / flt(self.quantity, self.precision("quantity")) total_rm_cost += d.amount base_total_rm_cost += d.base_amount