fix: patch for existing data

This commit is contained in:
Rohit Waghchaure
2025-11-10 15:02:10 +05:30
parent a66d643638
commit 91fcac5785
2 changed files with 18 additions and 0 deletions

View File

@@ -444,3 +444,4 @@ erpnext.patches.v16_0.rename_subcontracted_quantity
erpnext.patches.v16_0.add_new_stock_entry_types
erpnext.patches.v15_0.set_asset_status_if_not_already_set
erpnext.patches.v15_0.toggle_legacy_controller_for_period_closing
erpnext.patches.v16_0.update_serial_batch_entries

View File

@@ -0,0 +1,17 @@
import frappe
def execute():
if frappe.db.has_table("Serial and Batch Entry"):
frappe.db.sql(
"""
UPDATE `tabSerial and Batch Entry` SABE, `tabSerial and Batch Bundle` SABB
SET
SABE.posting_datetime = SABB.posting_datetime,
SABE.voucher_type = SABB.voucher_type,
SABE.voucher_no = SABB.voucher_no,
SABE.voucher_detail_no = SABB.voucher_detail_no,
SABE.type_of_transaction = SABB.type_of_transaction
WHERE SABE.parent = SABB.name
"""
)