[FIX] account_asset: don't recompute depreciation board on state change

When a user goes through the trouble of manually modifying the
depreciation lines he will lose all his work when clicking on 'reset to
draft'. Furthermore, if he then goes through the trouble of repairing
the problem by once again manually changing the depreciation lines he
will again lose his work when pressing confirm.

opw-678678
This commit is contained in:
Joren Van Onder
2016-05-30 16:17:19 +02:00
parent d5e478d4f0
commit fe511f18e1
+1 -1
View File
@@ -358,7 +358,7 @@ class AccountAssetAsset(models.Model):
@api.multi
def write(self, vals):
res = super(AccountAssetAsset, self).write(vals)
if 'depreciation_line_ids' not in vals:
if 'depreciation_line_ids' not in vals and 'state' not in vals:
self.compute_depreciation_board()
return res