[IMP] account_asset_management: Depreciation board compute upon asset confirmation

This commit is contained in:
Quentin Groulard
2020-04-23 10:40:38 +02:00
committed by manu
parent 66de39399f
commit 2dd8c15cfe
2 changed files with 5 additions and 1 deletions

View File

@@ -4,7 +4,7 @@
{
"name": "Assets Management",
"version": "13.0.1.0.2",
"version": "13.0.1.0.3",
"license": "AGPL-3",
"depends": ["account"],
"excludes": ["account_asset"],

View File

@@ -461,6 +461,10 @@ class AccountAsset(models.Model):
asset.state = "close"
else:
asset.state = "open"
if not asset.depreciation_line_ids.filtered(
lambda l: l.type != "create"
):
asset.compute_depreciation_board()
return True
def remove(self):