diff --git a/erpnext/accounts/doctype/budget/budget.js b/erpnext/accounts/doctype/budget/budget.js index 4b2aefffb57..3ac7b8fe8f8 100644 --- a/erpnext/accounts/doctype/budget/budget.js +++ b/erpnext/accounts/doctype/budget/budget.js @@ -4,16 +4,6 @@ frappe.provide("erpnext.accounts.dimensions"); frappe.ui.form.on("Budget", { onload: function (frm) { - frm.set_query("account", "accounts", function () { - return { - filters: { - company: frm.doc.company, - report_type: "Profit and Loss", - is_group: 0, - }, - }; - }); - frm.set_query("monthly_distribution", function () { return { filters: { @@ -30,17 +20,27 @@ frappe.ui.form.on("Budget", { }); }, - refresh: function (frm) { + refresh: async function (frm) { frm.trigger("toggle_reqd_fields"); if (!frm.doc.__islocal && frm.doc.docstatus == 1) { - frm.add_custom_button( - __("Revise Budget"), - function () { - frm.events.revise_budget_action(frm); - }, - __("Actions") + let exception_role = await frappe.db.get_value( + "Company", + frm.doc.company, + "exception_budget_approver_role" ); + + const role = exception_role.message.exception_budget_approver_role; + + if (role && frappe.user.has_role(role)) { + frm.add_custom_button( + __("Revise Budget"), + function () { + frm.events.revise_budget_action(frm); + }, + __("Actions") + ); + } } }, diff --git a/erpnext/accounts/doctype/budget/budget.json b/erpnext/accounts/doctype/budget/budget.json index bf1e7d091c1..8476a2831f0 100644 --- a/erpnext/accounts/doctype/budget/budget.json +++ b/erpnext/accounts/doctype/budget/budget.json @@ -184,6 +184,7 @@ "options": "\nStop\nWarn\nIgnore" }, { + "default": "BUDGET-.########", "fieldname": "naming_series", "fieldtype": "Select", "label": "Series", @@ -308,7 +309,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2025-11-17 17:38:27.759355", + "modified": "2025-11-19 17:00:00.648224", "modified_by": "Administrator", "module": "Accounts", "name": "Budget",