diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 7e53f0ff4c1..aef5666277c 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -160,7 +160,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) + posted_depreciation_line_ids = self.depreciation_line_ids.filtered(lambda x: x.move_check).sorted(key=lambda l: l.depreciation_date, reverse=True) 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