fix: null check for valuation rate (#19195)

* fix: null check for valuatiomn rate

* fix: add rate for item in test records

* refactor: use flt instead of throwing error

* Revert "fix: add rate for item in test records"

This reverts commit f8cebe65f5fe32382aba842f765d263511cbb082.
This commit is contained in:
Shivam Mishra 2019-10-04 11:58:04 +05:30 committed by Nabin Hait
parent 8b741cfefb
commit ba2faecdc7

View File

@ -173,7 +173,7 @@ class BOM(WebsiteGenerator):
#Customer Provided parts will have zero rate
if not frappe.db.get_value('Item', arg["item_code"], 'is_customer_provided_item'):
if arg.get('bom_no') and self.set_rate_of_sub_assembly_item_based_on_bom:
rate = self.get_bom_unitcost(arg['bom_no']) * (arg.get("conversion_factor") or 1)
rate = flt(self.get_bom_unitcost(arg['bom_no'])) * (arg.get("conversion_factor") or 1)
else:
if self.rm_cost_as_per == 'Valuation Rate':
rate = self.get_valuation_rate(arg) * (arg.get("conversion_factor") or 1)