2
0

[FIX] account_asset_management: Test data + onchange

This commit is contained in:
Luc De Meyer 2018-10-01 11:04:33 +02:00 committed by Rodrigo
parent 163eb03e63
commit 49d1c36679
2 changed files with 2 additions and 2 deletions

View File

@ -268,8 +268,7 @@ class AccountAsset(models.Model):
raise UserError(
_("The Start Date must precede the Ending Date."))
@api.onchange('purchase_value', 'salvage_value', 'date_start', 'method',
'depreciation_line_ids.type')
@api.onchange('purchase_value', 'salvage_value', 'date_start', 'method')
def _onchange_purchase_salvage_value(self):
if self.method in ['linear-limit', 'degr-limit']:
self.depreciation_base = self.purchase_value or 0.0

View File

@ -90,6 +90,7 @@
<field name="method_time">year</field>
<field name="method_number" eval="5"/>
<field name="method_period">year</field>
<field name="date_start" eval="time.strftime('%Y-01-01')"/>
<field name="name">CEO's Car</field>
<field name="purchase_value" eval="12000.0"/>
<field name="salvage_value" eval="2000.0"/>