mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 18:59:08 +00:00
perf(asset): fetch only distinct depreciable assets
This commit is contained in:
@@ -23,7 +23,7 @@ def post_depreciation_entries(date=None):
|
|||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
def get_depreciable_assets(date):
|
def get_depreciable_assets(date):
|
||||||
return frappe.db.sql_list("""select a.name
|
return frappe.db.sql_list("""select distinct a.name
|
||||||
from tabAsset a, `tabDepreciation Schedule` ds
|
from tabAsset a, `tabDepreciation Schedule` ds
|
||||||
where a.name = ds.parent and a.docstatus=1 and ds.schedule_date<=%s and a.calculate_depreciation = 1
|
where a.name = ds.parent and a.docstatus=1 and ds.schedule_date<=%s and a.calculate_depreciation = 1
|
||||||
and a.status in ('Submitted', 'Partially Depreciated')
|
and a.status in ('Submitted', 'Partially Depreciated')
|
||||||
|
|||||||
Reference in New Issue
Block a user