From 54184e54ed352a6264957e3efe659868a4523a11 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 15 Nov 2021 17:54:53 +0530 Subject: [PATCH] fix: patch for naming series property setter --- erpnext/patches.txt | 1 + .../patches/v13_0/item_naming_series_not_mandatory.py | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 erpnext/patches/v13_0/item_naming_series_not_mandatory.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 778cbdf65b..e475229125 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -306,6 +306,7 @@ erpnext.patches.v13_0.requeue_failed_reposts erpnext.patches.v13_0.update_job_card_status erpnext.patches.v12_0.update_production_plan_status erpnext.patches.v13_0.healthcare_deprecation_warning +erpnext.patches.v13_0.item_naming_series_not_mandatory erpnext.patches.v14_0.delete_healthcare_doctypes erpnext.patches.v13_0.update_category_in_ltds_certificate erpnext.patches.v13_0.create_pan_field_for_india #2 diff --git a/erpnext/patches/v13_0/item_naming_series_not_mandatory.py b/erpnext/patches/v13_0/item_naming_series_not_mandatory.py new file mode 100644 index 0000000000..5fe85a4830 --- /dev/null +++ b/erpnext/patches/v13_0/item_naming_series_not_mandatory.py @@ -0,0 +1,11 @@ +import frappe + +from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series + + +def execute(): + + stock_settings = frappe.get_doc("Stock Settings") + + set_by_naming_series("Item", "item_code", + stock_settings.get("item_naming_by")=="Naming Series", hide_name_field=True, make_mandatory=0)