From 41509d37af9ffa9eabe90aeead0e9f2e9e4f2e4e Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Fri, 13 Jun 2025 12:32:51 +0530 Subject: [PATCH] fix: patch to update child table parentfield name in pos closing entry (#48008) --- erpnext/patches.txt | 2 +- erpnext/patches/v15_0/rename_pos_closing_entry_fields.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index cf16cc37ee1..01269db4ba4 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -420,4 +420,4 @@ erpnext.patches.v15_0.remove_agriculture_roles erpnext.patches.v14_0.update_full_name_in_contract erpnext.patches.v15_0.drop_sle_indexes execute:frappe.db.set_single_value("Accounts Settings", "confirm_before_resetting_posting_date", 1) -erpnext.patches.v15_0.rename_pos_closing_entry_fields +erpnext.patches.v15_0.rename_pos_closing_entry_fields #2025-06-13 diff --git a/erpnext/patches/v15_0/rename_pos_closing_entry_fields.py b/erpnext/patches/v15_0/rename_pos_closing_entry_fields.py index 782f219c564..de5efa7f9f9 100644 --- a/erpnext/patches/v15_0/rename_pos_closing_entry_fields.py +++ b/erpnext/patches/v15_0/rename_pos_closing_entry_fields.py @@ -1,6 +1,8 @@ +import frappe from frappe.model.utils.rename_field import rename_field def execute(): - rename_field("POS Closing Entry", "pos_transactions", "pos_invoices") - rename_field("POS Closing Entry", "sales_invoice_transactions", "sales_invoices") + rename_field("POS Closing Entry", "pos_transactions", "pos_invoices", validate=False) + if frappe.db.exists("DocType", "Sales Invoice Reference"): + rename_field("POS Closing Entry", "sales_invoice_transactions", "sales_invoices", validate=False)