fix: budget migration for accounting dimensions

This commit is contained in:
khushi8112
2025-12-25 00:52:24 +05:30
parent 48c53c06ce
commit 8dacfdf287

View File

@@ -1,6 +1,10 @@
import frappe
from frappe.utils import add_months, flt, get_first_day, get_last_day
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
get_accounting_dimensions,
)
def execute():
remove_old_property_setter()
@@ -79,6 +83,10 @@ def create_new_budget_from_row(budget_doc, fiscal_year, account_row, percentage_
for field in core_fields:
new_budget.set(field, budget_doc.get(field))
for fieldname in get_accounting_dimensions():
if budget_doc.get(fieldname):
new_budget.set(fieldname, budget_doc.get(fieldname))
new_budget.from_fiscal_year = fiscal_year.name
new_budget.to_fiscal_year = fiscal_year.name
new_budget.budget_start_date = fiscal_year.year_start_date