[FIX] account_asset_management: Test data + onchange
This commit is contained in:
parent
163eb03e63
commit
49d1c36679
@ -268,8 +268,7 @@ class AccountAsset(models.Model):
|
|||||||
raise UserError(
|
raise UserError(
|
||||||
_("The Start Date must precede the Ending Date."))
|
_("The Start Date must precede the Ending Date."))
|
||||||
|
|
||||||
@api.onchange('purchase_value', 'salvage_value', 'date_start', 'method',
|
@api.onchange('purchase_value', 'salvage_value', 'date_start', 'method')
|
||||||
'depreciation_line_ids.type')
|
|
||||||
def _onchange_purchase_salvage_value(self):
|
def _onchange_purchase_salvage_value(self):
|
||||||
if self.method in ['linear-limit', 'degr-limit']:
|
if self.method in ['linear-limit', 'degr-limit']:
|
||||||
self.depreciation_base = self.purchase_value or 0.0
|
self.depreciation_base = self.purchase_value or 0.0
|
||||||
|
@ -90,6 +90,7 @@
|
|||||||
<field name="method_time">year</field>
|
<field name="method_time">year</field>
|
||||||
<field name="method_number" eval="5"/>
|
<field name="method_number" eval="5"/>
|
||||||
<field name="method_period">year</field>
|
<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="name">CEO's Car</field>
|
||||||
<field name="purchase_value" eval="12000.0"/>
|
<field name="purchase_value" eval="12000.0"/>
|
||||||
<field name="salvage_value" eval="2000.0"/>
|
<field name="salvage_value" eval="2000.0"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user