odoo/addons/account_asset/test/account_asset_wizard.yml

28 lines
1.1 KiB
YAML

-
I create a record to change the duration of asset for calculating depreciation.
-
!record {model: asset.modify, id: asset_modify_number_0, context: "{'active_id': ref('account_asset_asset_office0')}"}:
method_number: 10.0
-
I change the duration.
-
!python {model: asset.modify}: |
context = {"active_id":ref('account_asset_asset_office0')}
self.modify(cr, uid, [ref("asset_modify_number_0")], context=context)
-
I check the proper depreciation lines created.
-
!assert {model: account.asset.asset, id: account_asset.account_asset_asset_office0}:
- method_number == len(depreciation_line_ids)
-
I create a period to compute a asset on period.
-
!record {model: asset.depreciation.confirmation.wizard, id: asset_compute_period_0}:
{}
-
I compute a asset on period.
-
!python {model: asset.depreciation.confirmation.wizard}: |
context = {"active_ids": [ref("menu_asset_depreciation_confirmation_wizard")], "active_id":ref('menu_asset_depreciation_confirmation_wizard')}
self.asset_compute(cr, uid, [ref("asset_compute_period_0")], context=context)