[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'.
This commit is contained in:
Luc De Meyer
2024-12-21 17:01:59 +01:00
parent 0c4529c581
commit c08e82a98a

View File

@@ -499,7 +499,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)