2
0

account_asset_management: fix group_assets sorting

This commit is contained in:
JordiMForgeFlow 2021-04-14 11:58:17 +02:00 committed by Rodrigo
parent 9352bd825c
commit c0a3318da9

View File

@ -430,7 +430,9 @@ class AssetReportXlsx(models.AbstractModel):
group_assets = assets.filtered(lambda r: group in r.group_ids)
else:
group_assets = assets
group_assets = group_assets.sorted(lambda r: (r.date_start or "", r.code))
group_assets = group_assets.sorted(
lambda r: (r.date_start or "", r.code or "", r.name)
)
grouped_assets[group] = {"assets": group_assets}
for child in group.child_ids:
self._group_assets(assets, child, grouped_assets[group])