fix: ensure defaults removed in bad frappe patch get set again (backport #31659)
fix: ensure defaults removed in bad frappe patch get set again (#31659) (cherry picked from commitbf2833b8ee) (cherry picked from commit9071018e4e) Co-authored-by: Sagar Vora <sagar@resilient.tech>
This commit is contained in:
@@ -370,3 +370,4 @@ erpnext.patches.v13_0.job_card_status_on_hold
|
|||||||
erpnext.patches.v13_0.add_cost_center_in_loans
|
erpnext.patches.v13_0.add_cost_center_in_loans
|
||||||
erpnext.patches.v13_0.show_india_localisation_deprecation_warning
|
erpnext.patches.v13_0.show_india_localisation_deprecation_warning
|
||||||
erpnext.patches.v13_0.fix_number_and_frequency_for_monthly_depreciation
|
erpnext.patches.v13_0.fix_number_and_frequency_for_monthly_depreciation
|
||||||
|
erpnext.patches.v13_0.reset_corrupt_defaults
|
||||||
|
|||||||
29
erpnext/patches/v13_0/reset_corrupt_defaults.py
Normal file
29
erpnext/patches/v13_0/reset_corrupt_defaults.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
"""
|
||||||
|
This patch is needed to fix parent incorrectly set as `__2fa` because of
|
||||||
|
https://github.com/frappe/frappe/commit/a822092211533ff17ff9b92dd86f6f868ed63e2e
|
||||||
|
"""
|
||||||
|
|
||||||
|
for doctype in (
|
||||||
|
"Accounts Settings",
|
||||||
|
"Stock Settings",
|
||||||
|
"Selling Settings",
|
||||||
|
"Buying Settings",
|
||||||
|
"CRM Settings",
|
||||||
|
"Global Defaults",
|
||||||
|
"Healthcare Settings",
|
||||||
|
"Education Settings",
|
||||||
|
):
|
||||||
|
try:
|
||||||
|
frappe.get_single(doctype).save()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
pos_profile = frappe.get_last_doc("POS Profile")
|
||||||
|
pos_profile.set_defaults()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user