'Get raw materials considering sub-assembly items
"item_code": [qty_required, description, stock_uom, min_order_qty]'

def get_raw_materials(self, bom_dict, non_stock_item=0):

    item_list = []
    for (bom, so_wise_qty) in bom_dict.items():
        bom_wise_item_details = {}
        if (self.use_multi_level_bom and self.only_raw_materials and self.include_subcontracted):
            for d in frappe.db.sql(((u'select    fb.item_code,\n DCTB  DCTB  DCTB  DCTB  DCTB ifnull(sum(fb.stock_qty/ifnull(bom.quantity,    1)),    0)    as    qty,\n DCTB  DCTB  DCTB  DCTB  DCTB fb.description,    fb.stock_uom,    item.min_order_qty\n DCTB  DCTB  DCTB  DCTB  DCTB from    `tabBOM    Explosion    Item`    fb,    `tabBOM`    bom,    `tabItem`    item\n DCTB  DCTB  DCTB  DCTB  DCTB where    bom.name    =    fb.parent    and    item.name    =    fb.item_code\n DCTB  DCTB  DCTB  DCTB  DCTB and    (item.is_sub_contracted_item    =    0    or    ifnull(item.default_bom,    "")="")\n DCTB  DCTB  DCTB  DCTB  DCTB ' + (u'and    item.is_stock_item    =    1', u'')[non_stock_item]) + u'\n DCTB  DCTB  DCTB  DCTB  DCTB and    fb.docstatus<2    and    bom.name=%(bom)s\n DCTB  DCTB  DCTB  DCTB  DCTB group    by    fb.item_code,    fb.stock_uom'), {u'bom': bom}, as_dict=1):
                bom_wise_item_details.setdefault(d.item_code, d)
        else:
            bom_wise_item_details = self.get_subitems(bom_wise_item_details, bom, 1, self.use_multi_level_bom, self.only_raw_materials, self.include_subcontracted, non_stock_item)
        for (item, item_details) in bom_wise_item_details.items():
            for so_qty in so_wise_qty:
                item_list.append([item, (flt(item_details.qty) * so_qty[1]), item_details.description, item_details.stock_uom, item_details.min_order_qty, so_qty[0]])
    self.make_items_dict(item_list)
