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