chore: migration patch for account freezing fields

This commit is contained in:
Khushi Rawat
2025-06-13 20:20:54 +05:30
committed by khushi8112
parent eead484fd3
commit b27b35e1ae
2 changed files with 19 additions and 0 deletions

View File

@@ -265,6 +265,7 @@ erpnext.patches.v16_0.create_company_custom_fields
[post_model_sync]
erpnext.patches.v15_0.rename_gross_purchase_amount_to_net_purchase_amount
erpnext.patches.v15_0.migrate_account_freezing_settings_to_company
erpnext.patches.v15_0.create_asset_depreciation_schedules_from_assets
execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings')
erpnext.patches.v14_0.update_posting_datetime_and_dropped_indexes #22-02-2024

View File

@@ -0,0 +1,18 @@
import frappe
def execute():
accounts_settings = frappe.get_doc("Accounts Settings", "Accounts Settings")
accounts_frozen_till_date = accounts_settings.acc_frozen_upto
frozen_accounts_modifier = accounts_settings.frozen_accounts_modifier
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,
},
)