Patch to set calculate_depreciation if schedule already exists (#12061)

This commit is contained in:
Nabin Hait 2017-12-16 11:17:36 +05:30 committed by GitHub
parent e3b5c0f727
commit 4c816a1054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -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)
""")