From 6e7a4fb4cafaabccdb5f3d030f94b7797b192ae7 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Sat, 21 Dec 2024 17:01:59 +0100 Subject: [PATCH] [FIX] account_asset_management: fix asset report The Financial Assets report generates an error message where there is an asset without depreciation table. This is ok for most assets but not for those with method_number = 0 which is the case for assets of type 'Land and Buildings'. --- account_asset_management/report/account_asset_report_xls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_asset_management/report/account_asset_report_xls.py b/account_asset_management/report/account_asset_report_xls.py index dab9155c9..81fde8319 100644 --- a/account_asset_management/report/account_asset_report_xls.py +++ b/account_asset_management/report/account_asset_report_xls.py @@ -494,7 +494,7 @@ class AssetReportXlsx(models.AbstractModel): lambda r: r.type == "depreciate" ) dls_all = dls_all.sorted(key=lambda r: r.line_date) - if not dls_all: + if not dls_all and asset.method_number: error_dict["no_table"] += asset # period_start_value dls = dls_all.filtered(lambda r: r.line_date <= wiz.date_from)