mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-30 12:08:26 +00:00
fix: patch to migrate setting
This commit is contained in:
@@ -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,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user