def make_packing_list(doc):
 if (doc.get(u'_action') and (doc._action == u'update_after_submit')):
  return
 parent_items = []
 for d in doc.get(u'items'):
  if frappe.db.get_value(u'Product Bundle', {u'new_item_code': d.item_code}):
   for i in get_product_bundle_items(d.item_code):
    update_packing_list_item(doc, i.item_code, (flt(i.qty) * flt(d.qty)), d, i.description)
   if ([d.item_code, d.name] not in parent_items):
    parent_items.append([d.item_code, d.name])
 cleanup_packing_list(doc, parent_items)

def make_packing_list ( doc ) : if ( doc . get ( u'_action' ) and ( doc . _action == u'update_after_submit' ) ) : return parent_items = [ ] for d in doc . get ( u'items' ) : if frappe . db . get_value ( u'Product Bundle' , { u'new_item_code' : d . item_code } ) : for i in get_product_bundle_items ( d . item_code ) : update_packing_list_item ( doc , i . item_code , ( flt ( i . qty ) * flt ( d . qty ) ) , d , i . description ) if ( [ d . item_code , d . name ] not in parent_items ) : parent_items . append ( [ d . item_code , d . name ] ) cleanup_packing_list ( doc , parent_items )
make packing list for product bundle item .