2017-12-16 11:17:36 +05:30
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
2017-12-18 12:31:23 +05:30
|
|
|
frappe.reload_doc('assets', 'doctype', 'asset')
|
|
|
|
frappe.reload_doc('assets', 'doctype', 'depreciation_schedule')
|
|
|
|
|
2017-12-16 11:17:36 +05:30
|
|
|
frappe.db.sql("""
|
|
|
|
update tabAsset a
|
|
|
|
set calculate_depreciation = 1
|
|
|
|
where exists(select ds.name from `tabDepreciation Schedule` ds where ds.parent=a.name)
|
|
|
|
""")
|