Patch to set calculate_depreciation if schedule already exists (#12061)
This commit is contained in:
parent
e3b5c0f727
commit
4c816a1054
@ -482,4 +482,5 @@ erpnext.patches.v10_0.add_non_profit_domain
|
||||
erpnext.patches.v10_0.setup_vat_for_uae_and_saudi_arabia
|
||||
erpnext.patches.v10_0.set_primary_contact_for_customer
|
||||
erpnext.patches.v10_0.copy_projects_renamed_fields
|
||||
erpnext.patches.v10_0.enabled_regional_print_format_based_on_country
|
||||
erpnext.patches.v10_0.enabled_regional_print_format_based_on_country
|
||||
erpnext.patches.v10_0.update_asset_calculate_depreciation
|
||||
|
@ -0,0 +1,8 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.db.sql("""
|
||||
update tabAsset a
|
||||
set calculate_depreciation = 1
|
||||
where exists(select ds.name from `tabDepreciation Schedule` ds where ds.parent=a.name)
|
||||
""")
|
Loading…
x
Reference in New Issue
Block a user