From c4bdf2a721de22fd596bc2a378f02727d7aeb2cc Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Mon, 16 Jun 2025 16:27:18 +0530 Subject: [PATCH] fix: budget naming series (#48075) --- erpnext/accounts/doctype/budget/budget.json | 10 +++++----- erpnext/accounts/doctype/budget/budget.py | 5 +---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/erpnext/accounts/doctype/budget/budget.json b/erpnext/accounts/doctype/budget/budget.json index 7f066568517..fcd78691a03 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", @@ -199,12 +199,12 @@ }, { "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 }, { @@ -238,7 +238,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2025-05-22 13:46:28.510566", + "modified": "2025-06-16 15:57:13.114981", "modified_by": "Administrator", "module": "Accounts", "name": "Budget", diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index 11fa72c3c2f..7825b2716dc 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -51,7 +51,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 @@ -139,9 +139,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)