mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
fix: budget migration for accounting dimensions
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from frappe.utils import add_months, flt, get_first_day, get_last_day
|
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():
|
def execute():
|
||||||
remove_old_property_setter()
|
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:
|
for field in core_fields:
|
||||||
new_budget.set(field, budget_doc.get(field))
|
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.from_fiscal_year = fiscal_year.name
|
||||||
new_budget.to_fiscal_year = fiscal_year.name
|
new_budget.to_fiscal_year = fiscal_year.name
|
||||||
new_budget.budget_start_date = fiscal_year.year_start_date
|
new_budget.budget_start_date = fiscal_year.year_start_date
|
||||||
|
|||||||
Reference in New Issue
Block a user