From 4d18fd0e80a793a581bcf6f42af721a3b94f4e19 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 11:21:54 +0530 Subject: [PATCH] fix: budget naming series (backport #48075) (#48080) * fix: budget naming series (#48075) (cherry picked from commit c4bdf2a721de22fd596bc2a378f02727d7aeb2cc) # Conflicts: # erpnext/accounts/doctype/budget/budget.json * chore: resolve conflict --------- Co-authored-by: Diptanil Saha --- erpnext/accounts/doctype/budget/budget.json | 12 ++++++------ erpnext/accounts/doctype/budget/budget.py | 5 +---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/doctype/budget/budget.json b/erpnext/accounts/doctype/budget/budget.json index f0566f44368..9d70b85f5c7 100644 --- a/erpnext/accounts/doctype/budget/budget.json +++ b/erpnext/accounts/doctype/budget/budget.json @@ -7,10 +7,10 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ + "naming_series", "budget_against", "company", "cost_center", - "naming_series", "project", "fiscal_year", "column_break_3", @@ -195,19 +195,19 @@ }, { "fieldname": "naming_series", - "fieldtype": "Data", - "hidden": 1, + "fieldtype": "Select", "label": "Series", "no_copy": 1, + "options": "BUDGET-.YYYY.-", "print_hide": 1, - "read_only": 1, + "reqd": 1, "set_only_once": 1 } ], "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2022-10-10 22:14:36.361509", + "modified": "2025-06-16 15:57:13.114981", "modified_by": "Administrator", "module": "Accounts", "name": "Budget", @@ -235,4 +235,4 @@ "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index 2f2b549cf46..d31f72f062e 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -48,7 +48,7 @@ class Budget(Document): cost_center: DF.Link | None fiscal_year: DF.Link monthly_distribution: DF.Link | None - naming_series: DF.Data | None + naming_series: DF.Literal["BUDGET-.YYYY.-"] project: DF.Link | None # end: auto-generated types @@ -136,9 +136,6 @@ class Budget(Document): ): self.applicable_on_booking_actual_expenses = 1 - def before_naming(self): - self.naming_series = f"{{{frappe.scrub(self.budget_against)}}}./.{self.fiscal_year}/.###" - def validate_expense_against_budget(args, expense_amount=0): args = frappe._dict(args)