Merge pull request #30114 from nextchamp-saqib/fix-#23231
perf(asset): fetch only distinct depreciable assets
This commit is contained in:
commit
17e16247b1
@ -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')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user