'Add all items from Flat BOM of child BOM'

def get_child_exploded_items(self, bom_no, stock_qty):

    child_fb_items = frappe.db.sql(u'select    bom_item.item_code,    bom_item.item_name,\n DCTB  DCTB  DCTB bom_item.description,    bom_item.source_warehouse,\n DCTB  DCTB  DCTB bom_item.stock_uom,    bom_item.stock_qty,    bom_item.rate,\n DCTB  DCTB  DCTB bom_item.stock_qty    /    ifnull(bom.quantity,    1)    as    qty_consumed_per_unit\n DCTB  DCTB  DCTB from    `tabBOM    Explosion    Item`    bom_item,    tabBOM    bom\n DCTB  DCTB  DCTB where    bom_item.parent    =    bom.name    and    bom.name    =    %s    and    bom.docstatus    =    1', bom_no, as_dict=1)
    for d in child_fb_items:
        self.add_to_cur_exploded_items(frappe._dict({u'item_code': d[u'item_code'], u'item_name': d[u'item_name'], u'source_warehouse': d[u'source_warehouse'], u'description': d[u'description'], u'stock_uom': d[u'stock_uom'], u'stock_qty': (d[u'qty_consumed_per_unit'] * stock_qty), u'rate': flt(d[u'rate'])}))
