2019-01-22 12:52:20 +00:00
|
|
|
from __future__ import unicode_literals
|
2017-12-16 05:47:36 +00:00
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
2017-12-18 07:01:23 +00:00
|
|
|
frappe.reload_doc('assets', 'doctype', 'asset')
|
|
|
|
frappe.reload_doc('assets', 'doctype', 'depreciation_schedule')
|
|
|
|
|
2017-12-16 05:47:36 +00:00
|
|
|
frappe.db.sql("""
|
|
|
|
update tabAsset a
|
|
|
|
set calculate_depreciation = 1
|
|
|
|
where exists(select ds.name from `tabDepreciation Schedule` ds where ds.parent=a.name)
|
|
|
|
""")
|