Skip to content

Commit

Permalink
patch: subs naming series (#857) (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
fproldan authored Feb 8, 2024
1 parent 609bcc3 commit 93ab657
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
erpnext.patches.v13_0.naming_series_subs
erpnext.patches.v13_0.naming_series_subs_2
14 changes: 14 additions & 0 deletions erpnext/patches/v13_0/naming_series_subs_2.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 93ab657

Please sign in to comment.