[14.0][FIX] account_asset_management, error on remove for asset no depre

This commit is contained in:
Kitti U
2021-09-07 16:47:37 +07:00
committed by manu
parent e9d0a63891
commit d0e6ea4d0d

View File

@@ -252,6 +252,8 @@ class AccountAssetRemove(models.TransientModel):
if not dlines:
asset.compute_depreciation_board()
dlines = _dlines(asset)
if not dlines:
return asset.value_residual
first_to_depreciate_dl = dlines[0]
first_date = first_to_depreciate_dl.line_date