From 7ce9f7bc120a59cbf40cf791bffbfd476f81afbb Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 10 Jun 2024 19:08:59 +0530 Subject: [PATCH] chore: patch to enable old serial/batch fields (#41723) * chore: patch to enable old serial/batch fields * chore: fix linters issue --- erpnext/patches.txt | 1 + erpnext/patches/v15_0/enable_old_serial_batch_fields.py | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 erpnext/patches/v15_0/enable_old_serial_batch_fields.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 4f02329f0a3..114e88d2e40 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -369,3 +369,4 @@ erpnext.patches.v15_0.rename_purchase_receipt_amount_to_purchase_amount erpnext.patches.v14_0.enable_set_priority_for_pricing_rules #1 erpnext.patches.v15_0.rename_number_of_depreciations_booked_to_opening_booked_depreciations erpnext.patches.v15_0.add_default_operations +erpnext.patches.v15_0.enable_old_serial_batch_fields diff --git a/erpnext/patches/v15_0/enable_old_serial_batch_fields.py b/erpnext/patches/v15_0/enable_old_serial_batch_fields.py new file mode 100644 index 00000000000..f986d9f88b1 --- /dev/null +++ b/erpnext/patches/v15_0/enable_old_serial_batch_fields.py @@ -0,0 +1,7 @@ +import frappe + + +def execute(): + sabb = frappe.get_all("Serial and Batch Bundle", filters={"docstatus": ("<", 2)}, limit=1) + if not sabb: + frappe.db.set_single_value("Stock Settings", "use_serial_batch_fields", 1)