Merge pull request #51325 from khushi8112/budget-migration-accounting-dimensions

fix: budget migration for accounting dimensions
This commit is contained in:
Khushi Rawat
2025-12-26 11:55:05 +05:30
committed by GitHub

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