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