def get_item_bom_rate():
 item_bom_map = {}
 for b in frappe.db.sql(u'select item, (total_cost/quantity) as bom_rate\n DCTB  DCTB from `tabBOM` where is_active=1 and is_default=1', as_dict=1):
  item_bom_map.setdefault(b.item, flt(b.bom_rate))
 return item_bom_map

def get_item_bom_rate ( ) : item_bom_map = { } for b in frappe . db . sql ( u'select item, (total_cost/quantity) as bom_rate\n DCTB  DCTB from `tabBOM` where is_active=1 and is_default=1' , as_dict = 1 ) : item_bom_map . setdefault ( b . item , flt ( b . bom_rate ) ) return item_bom_map
get bom rate of an item from bom .