refactor: single table for better performance

This commit is contained in:
Rohit Waghchaure
2026-01-11 11:44:48 +05:30
parent f23c11256c
commit 8d4a179a8f
8 changed files with 138 additions and 29 deletions

View File

@@ -921,6 +921,10 @@ class StockController(AccountsController):
"Serial and Batch Bundle", row.serial_and_batch_bundle, {"is_cancelled": 1}
)
frappe.db.set_value(
"Serial and Batch Entry", {"parent": row.serial_and_batch_bundle}, {"is_cancelled": 1}
)
if update_values:
row.db_set(update_values)
@@ -929,6 +933,12 @@ class StockController(AccountsController):
"Serial and Batch Bundle", row.rejected_serial_and_batch_bundle, {"is_cancelled": 1}
)
frappe.db.set_value(
"Serial and Batch Entry",
{"parent": row.rejected_serial_and_batch_bundle},
{"is_cancelled": 1},
)
row.db_set("rejected_serial_and_batch_bundle", None)
if row.get("current_serial_and_batch_bundle"):
@@ -2310,6 +2320,7 @@ def make_bundle_for_material_transfer(**kwargs):
row.voucher_no = bundle_doc.voucher_no
row.voucher_detail_no = bundle_doc.voucher_detail_no
row.type_of_transaction = bundle_doc.type_of_transaction
row.item_code = bundle_doc.item_code
bundle_doc.set_incoming_rate()
bundle_doc.calculate_qty_and_amount()