refactor: rename checkbox for budget controller

This commit is contained in:
ruthra kumar
2025-09-10 09:52:14 +05:30
parent 1f91dcb1bd
commit d3d03e8d83
4 changed files with 11 additions and 11 deletions

View File

@@ -98,7 +98,7 @@
"payment_request_settings", "payment_request_settings",
"create_pr_in_draft_status", "create_pr_in_draft_status",
"budget_settings", "budget_settings",
"use_new_budget_controller" "use_legacy_budget_controller"
], ],
"fields": [ "fields": [
{ {
@@ -598,12 +598,6 @@
"fieldtype": "Tab Break", "fieldtype": "Tab Break",
"label": "Budget" "label": "Budget"
}, },
{
"default": "1",
"fieldname": "use_new_budget_controller",
"fieldtype": "Check",
"label": "Use New Budget Controller"
},
{ {
"default": "1", "default": "1",
"description": "If enabled, user will be alerted before resetting posting date to current date in relevant transactions", "description": "If enabled, user will be alerted before resetting posting date to current date in relevant transactions",
@@ -651,6 +645,12 @@
"fieldname": "fetch_valuation_rate_for_internal_transaction", "fieldname": "fetch_valuation_rate_for_internal_transaction",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Fetch Valuation Rate for Internal Transaction" "label": "Fetch Valuation Rate for Internal Transaction"
},
{
"default": "0",
"fieldname": "use_legacy_budget_controller",
"fieldtype": "Check",
"label": "Use Legacy Budget Controller"
} }
], ],
"grid_page_length": 50, "grid_page_length": 50,
@@ -659,7 +659,7 @@
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2025-07-18 13:56:47.192437", "modified": "2025-09-24 16:08:08.515254",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Accounts Settings", "name": "Accounts Settings",

View File

@@ -74,7 +74,7 @@ class AccountsSettings(Document):
submit_journal_entries: DF.Check submit_journal_entries: DF.Check
unlink_advance_payment_on_cancelation_of_order: DF.Check unlink_advance_payment_on_cancelation_of_order: DF.Check
unlink_payment_on_cancellation_of_invoice: DF.Check unlink_payment_on_cancellation_of_invoice: DF.Check
use_new_budget_controller: DF.Check use_legacy_budget_controller: DF.Check
# end: auto-generated types # end: auto-generated types
def validate(self): def validate(self):

View File

@@ -35,7 +35,7 @@ def make_gl_entries(
): ):
if gl_map: if gl_map:
if ( if (
frappe.get_single_value("Accounts Settings", "use_new_budget_controller") not cint(frappe.get_single_value("Accounts Settings", "use_legacy_budget_controller"))
and gl_map[0].voucher_type != "Period Closing Voucher" and gl_map[0].voucher_type != "Period Closing Voucher"
): ):
bud_val = BudgetValidation(gl_map=gl_map) bud_val = BudgetValidation(gl_map=gl_map)

View File

@@ -875,7 +875,7 @@ class BuyingController(SubcontractingController):
self.update_fixed_asset(field, delete_asset=True) self.update_fixed_asset(field, delete_asset=True)
def validate_budget(self): def validate_budget(self):
if frappe.get_single_value("Accounts Settings", "use_new_budget_controller"): if not frappe.get_single_value("Accounts Settings", "use_legacy_budget_controller"):
from erpnext.controllers.budget_controller import BudgetValidation from erpnext.controllers.budget_controller import BudgetValidation
val = BudgetValidation(doc=self) val = BudgetValidation(doc=self)