fix: remove unnecessary param, and use value from self

(cherry picked from commit 98dfd64f63)
This commit is contained in:
Smit Vora
2026-04-07 13:17:22 +05:30
committed by Mergify
parent 6cebea314d
commit 7bef9542d4

View File

@@ -345,9 +345,7 @@ class StockEntry(StockController, SubcontractingInwardController):
scale_factor = flt(self.fg_completed_qty) / source_fg_qty if source_fg_qty else 0 scale_factor = flt(self.fg_completed_qty) / source_fg_qty if source_fg_qty else 0
bundle_data = get_voucher_wise_serial_batch_from_bundle(voucher_no=[self.source_stock_entry]) bundle_data = get_voucher_wise_serial_batch_from_bundle(voucher_no=[self.source_stock_entry])
source_rows_by_name = { source_rows_by_name = {r.name: r for r in self.get_items_from_manufacture_stock_entry()}
r.name: r for r in self.get_items_from_manufacture_stock_entry(self.source_stock_entry)
}
for row in self.items: for row in self.items:
if not row.ste_detail: if not row.ste_detail:
@@ -2378,7 +2376,6 @@ class StockEntry(StockController, SubcontractingInwardController):
self._append_disassembly_row_from_source( self._append_disassembly_row_from_source(
disassemble_qty=disassemble_qty, disassemble_qty=disassemble_qty,
scale_factor=scale_factor, scale_factor=scale_factor,
source_stock_entry=self.source_stock_entry,
) )
def _add_items_for_disassembly_from_work_order(self): def _add_items_for_disassembly_from_work_order(self):
@@ -2399,8 +2396,8 @@ class StockEntry(StockController, SubcontractingInwardController):
scale_factor=scale_factor, scale_factor=scale_factor,
) )
def _append_disassembly_row_from_source(self, disassemble_qty, scale_factor, source_stock_entry=None): def _append_disassembly_row_from_source(self, disassemble_qty, scale_factor):
for source_row in self.get_items_from_manufacture_stock_entry(self.source_stock_entry): for source_row in self.get_items_from_manufacture_stock_entry():
if source_row.is_finished_item: if source_row.is_finished_item:
qty = disassemble_qty qty = disassemble_qty
s_warehouse = self.from_warehouse or source_row.t_warehouse s_warehouse = self.from_warehouse or source_row.t_warehouse
@@ -2436,10 +2433,10 @@ class StockEntry(StockController, SubcontractingInwardController):
"use_serial_batch_fields": 1 if (source_row.batch_no or source_row.serial_no) else 0, "use_serial_batch_fields": 1 if (source_row.batch_no or source_row.serial_no) else 0,
} }
if source_stock_entry: if self.source_stock_entry:
item.update( item.update(
{ {
"against_stock_entry": source_stock_entry, "against_stock_entry": self.source_stock_entry,
"ste_detail": source_row.name, "ste_detail": source_row.name,
} }
) )
@@ -2486,7 +2483,7 @@ class StockEntry(StockController, SubcontractingInwardController):
# Finished goods # Finished goods
self.load_items_from_bom() self.load_items_from_bom()
def get_items_from_manufacture_stock_entry(self, stock_entry=None): def get_items_from_manufacture_stock_entry(self):
SE = frappe.qb.DocType("Stock Entry") SE = frappe.qb.DocType("Stock Entry")
SED = frappe.qb.DocType("Stock Entry Detail") SED = frappe.qb.DocType("Stock Entry Detail")
query = frappe.qb.from_(SED).join(SE).on(SED.parent == SE.name).where(SE.docstatus == 1) query = frappe.qb.from_(SED).join(SE).on(SED.parent == SE.name).where(SE.docstatus == 1)
@@ -2511,10 +2508,10 @@ class StockEntry(StockController, SubcontractingInwardController):
SED.bom_no, SED.bom_no,
] ]
if stock_entry: if self.source_stock_entry:
return ( return (
query.select(SED.name, SED.qty, SED.transfer_qty, *common_fields) query.select(SED.name, SED.qty, SED.transfer_qty, *common_fields)
.where(SE.name == stock_entry) .where(SE.name == self.source_stock_entry)
.orderby(SED.idx) .orderby(SED.idx)
.run(as_dict=True) .run(as_dict=True)
) )