@@ -342,9 +342,7 @@ def _set_serial_batch_for_disassembly_from_stock_entry(self):
342342 scale_factor = flt (self .fg_completed_qty ) / source_fg_qty if source_fg_qty else 0
343343
344344 bundle_data = get_voucher_wise_serial_batch_from_bundle (voucher_no = [self .source_stock_entry ])
345- source_rows_by_name = {
346- r .name : r for r in self .get_items_from_manufacture_stock_entry (self .source_stock_entry )
347- }
345+ source_rows_by_name = {r .name : r for r in self .get_items_from_manufacture_stock_entry ()}
348346
349347 for row in self .items :
350348 if not row .ste_detail :
@@ -2375,7 +2373,6 @@ def _add_items_for_disassembly_from_stock_entry(self):
23752373 self ._append_disassembly_row_from_source (
23762374 disassemble_qty = disassemble_qty ,
23772375 scale_factor = scale_factor ,
2378- source_stock_entry = self .source_stock_entry ,
23792376 )
23802377
23812378 def _add_items_for_disassembly_from_work_order (self ):
@@ -2396,8 +2393,8 @@ def _add_items_for_disassembly_from_work_order(self):
23962393 scale_factor = scale_factor ,
23972394 )
23982395
2399- def _append_disassembly_row_from_source (self , disassemble_qty , scale_factor , source_stock_entry = None ):
2400- for source_row in self .get_items_from_manufacture_stock_entry (self . source_stock_entry ):
2396+ def _append_disassembly_row_from_source (self , disassemble_qty , scale_factor ):
2397+ for source_row in self .get_items_from_manufacture_stock_entry ():
24012398 if source_row .is_finished_item :
24022399 qty = disassemble_qty
24032400 s_warehouse = self .from_warehouse or source_row .t_warehouse
@@ -2433,10 +2430,10 @@ def _append_disassembly_row_from_source(self, disassemble_qty, scale_factor, sou
24332430 "use_serial_batch_fields" : 1 if (source_row .batch_no or source_row .serial_no ) else 0 ,
24342431 }
24352432
2436- if source_stock_entry :
2433+ if self . source_stock_entry :
24372434 item .update (
24382435 {
2439- "against_stock_entry" : source_stock_entry ,
2436+ "against_stock_entry" : self . source_stock_entry ,
24402437 "ste_detail" : source_row .name ,
24412438 }
24422439 )
@@ -2483,7 +2480,7 @@ def _add_items_for_disassembly_from_bom(self):
24832480 # Finished goods
24842481 self .load_items_from_bom ()
24852482
2486- def get_items_from_manufacture_stock_entry (self , stock_entry = None ):
2483+ def get_items_from_manufacture_stock_entry (self ):
24872484 SE = frappe .qb .DocType ("Stock Entry" )
24882485 SED = frappe .qb .DocType ("Stock Entry Detail" )
24892486 query = frappe .qb .from_ (SED ).join (SE ).on (SED .parent == SE .name ).where (SE .docstatus == 1 )
@@ -2508,10 +2505,10 @@ def get_items_from_manufacture_stock_entry(self, stock_entry=None):
25082505 SED .bom_no ,
25092506 ]
25102507
2511- if stock_entry :
2508+ if self . source_stock_entry :
25122509 return (
25132510 query .select (SED .name , SED .qty , SED .transfer_qty , * common_fields )
2514- .where (SE .name == stock_entry )
2511+ .where (SE .name == self . source_stock_entry )
25152512 .orderby (SED .idx )
25162513 .run (as_dict = True )
25172514 )
0 commit comments