def allow_serial_nos_with_different_item(sle_serial_no, sle):
 allow_serial_nos = False
 if ((sle.voucher_type == u'Stock Entry') and (sle.actual_qty > 0)):
  stock_entry = frappe.get_doc(u'Stock Entry', sle.voucher_no)
  if (stock_entry.purpose in (u'Repack', u'Manufacture')):
   for d in stock_entry.get(u'items'):
    if (d.serial_no and (d.s_warehouse if (sle.is_cancelled == u'No') else d.t_warehouse)):
     serial_nos = get_serial_nos(d.serial_no)
     if (sle_serial_no in serial_nos):
      allow_serial_nos = True
 return allow_serial_nos

def allow_serial_nos_with_different_item ( sle_serial_no , sle ) : allow_serial_nos = False if ( ( sle . voucher_type == u'Stock Entry' ) and ( sle . actual_qty > 0 ) ) : stock_entry = frappe . get_doc ( u'Stock Entry' , sle . voucher_no ) if ( stock_entry . purpose in ( u'Repack' , u'Manufacture' ) ) : for d in stock_entry . get ( u'items' ) : if ( d . serial_no and ( d . s_warehouse if ( sle . is_cancelled == u'No' ) else d . t_warehouse ) ) : serial_nos = get_serial_nos ( d . serial_no ) if ( sle_serial_no in serial_nos ) : allow_serial_nos = True return allow_serial_nos
allows same serial nos for raw materials and finished goods in manufacture / repack type stock entry .