fix: Post GL entry fix for asset (#19751)
This commit is contained in:
parent
053d9ffe86
commit
98a54355ae
@ -517,11 +517,14 @@ def update_maintenance_status():
|
|||||||
asset.set_status('Out of Order')
|
asset.set_status('Out of Order')
|
||||||
|
|
||||||
def make_post_gl_entry():
|
def make_post_gl_entry():
|
||||||
if not is_cwip_accounting_enabled(self.asset_category):
|
|
||||||
return
|
|
||||||
|
|
||||||
|
asset_categories = frappe.db.get_all('Asset Category', fields = ['name', 'enable_cwip_accounting'])
|
||||||
|
|
||||||
|
for asset_category in asset_categories:
|
||||||
|
if cint(asset_category.enable_cwip_accounting):
|
||||||
assets = frappe.db.sql_list(""" select name from `tabAsset`
|
assets = frappe.db.sql_list(""" select name from `tabAsset`
|
||||||
where ifnull(booked_fixed_asset, 0) = 0 and available_for_use_date = %s""", nowdate())
|
where asset_category = %s and ifnull(booked_fixed_asset, 0) = 0
|
||||||
|
and available_for_use_date = %s""", (asset_category.name, nowdate()))
|
||||||
|
|
||||||
for asset in assets:
|
for asset in assets:
|
||||||
doc = frappe.get_doc('Asset', asset)
|
doc = frappe.get_doc('Asset', asset)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user