From 4df20a312223f9a5737f0c93a550b5295fc4e98f Mon Sep 17 00:00:00 2001 From: khushi8112 Date: Mon, 1 Dec 2025 12:53:33 +0530 Subject: [PATCH] fix: patch to migrate setting --- .../migrate_account_freezing_settings_to_company.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/erpnext/patches/v15_0/migrate_account_freezing_settings_to_company.py b/erpnext/patches/v15_0/migrate_account_freezing_settings_to_company.py index 0ae7764f07c..2801b1c9a65 100644 --- a/erpnext/patches/v15_0/migrate_account_freezing_settings_to_company.py +++ b/erpnext/patches/v15_0/migrate_account_freezing_settings_to_company.py @@ -2,17 +2,18 @@ import frappe def execute(): - accounts_settings = frappe.get_doc("Accounts Settings", "Accounts Settings") + frozen_till = frappe.db.get_single_value("Accounts Settings", "acc_frozen_upto") + modifier = frappe.db.get_single_value("Accounts Settings", "frozen_accounts_modifier") - accounts_frozen_till_date = accounts_settings.acc_frozen_upto - frozen_accounts_modifier = accounts_settings.frozen_accounts_modifier + if not frozen_till and not modifier: + return for company in frappe.get_all("Company", pluck="name"): frappe.db.set_value( "Company", company, { - "accounts_frozen_till_date": accounts_frozen_till_date, - "role_allowed_for_frozen_entries": frozen_accounts_modifier, + "accounts_frozen_till_date": frozen_till, + "role_allowed_for_frozen_entries": modifier, }, )