From 93ab65781f5b9c9c9e71b60ba6d0354d82a0b17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Rold=C3=A1n?= Date: Thu, 8 Feb 2024 15:00:55 -0300 Subject: [PATCH] patch: subs naming series (#857) (#858) --- erpnext/patches.txt | 3 ++- erpnext/patches/v13_0/naming_series_subs_2.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v13_0/naming_series_subs_2.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index d8f9ba675ef4..83e40e382c09 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -368,4 +368,5 @@ erpnext.patches.v13_0.remove_auditor_role_from_users erpnext.patches.v13_0.remove_old_hr_domains erpnext.patches.v13_0.release_1_8 erpnext.patches.v13_0.release_1_9 -erpnext.patches.v13_0.naming_series_subs \ No newline at end of file +erpnext.patches.v13_0.naming_series_subs +erpnext.patches.v13_0.naming_series_subs_2 diff --git a/erpnext/patches/v13_0/naming_series_subs_2.py b/erpnext/patches/v13_0/naming_series_subs_2.py new file mode 100644 index 000000000000..b407b3391755 --- /dev/null +++ b/erpnext/patches/v13_0/naming_series_subs_2.py @@ -0,0 +1,14 @@ +# Copyright (c) 2019, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe + +def execute(): + subs = frappe.get_all('Subscription', {'naming_series': ''}, order_by='creation desc', pluck='name') + if not subs: + return + + for sub in subs: + frappe.db.set_value('Subscription', sub, 'naming_series', 'ACC-SUB-.YYYY.-.#####') + frappe.db.commit() \ No newline at end of file