diff --git a/erpnext/patches/v16_0/migrate_budget_records_to_new_structure.py b/erpnext/patches/v16_0/migrate_budget_records_to_new_structure.py index c9a18ebff31..5d6dc25c3ea 100644 --- a/erpnext/patches/v16_0/migrate_budget_records_to_new_structure.py +++ b/erpnext/patches/v16_0/migrate_budget_records_to_new_structure.py @@ -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