From b7970130e509ce8d352b448ff7166c39f6dfea66 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 15 Jun 2016 10:17:27 +0200 Subject: [PATCH] [FIX] account_asset: ordered posted depreciation lines To recompute the depreciation board the last depreciation date must be taken. opw:679212 --- addons/account_asset/account_asset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 4118d531cac..951c28a8a7a 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -154,7 +154,7 @@ class AccountAssetAsset(models.Model): def compute_depreciation_board(self): self.ensure_one() - posted_depreciation_line_ids = self.depreciation_line_ids.filtered(lambda x: x.move_check).sorted(key=lambda l: l.depreciation_date, reverse=True) + posted_depreciation_line_ids = self.depreciation_line_ids.filtered(lambda x: x.move_check).sorted(key=lambda l: l.depreciation_date) unposted_depreciation_line_ids = self.depreciation_line_ids.filtered(lambda x: not x.move_check) # Remove old unposted depreciation lines. We cannot use unlink() with One2many field