fix: patch to migrate setting

This commit is contained in:
khushi8112
2025-12-01 12:53:33 +05:30
parent 29048c3364
commit 4df20a3122

View File

@@ -2,17 +2,18 @@ import frappe
def execute(): 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 if not frozen_till and not modifier:
frozen_accounts_modifier = accounts_settings.frozen_accounts_modifier return
for company in frappe.get_all("Company", pluck="name"): for company in frappe.get_all("Company", pluck="name"):
frappe.db.set_value( frappe.db.set_value(
"Company", "Company",
company, company,
{ {
"accounts_frozen_till_date": accounts_frozen_till_date, "accounts_frozen_till_date": frozen_till,
"role_allowed_for_frozen_entries": frozen_accounts_modifier, "role_allowed_for_frozen_entries": modifier,
}, },
) )