36 lines
1.5 KiB
YAML
36 lines
1.5 KiB
YAML
-
|
|
In order to test the process of Account Asset, I perform a action to confirm Account Asset.
|
|
-
|
|
!python {model: account.asset.asset}: |
|
|
self.validate(cr, uid, [ref("account_asset_asset_vehicles0")])
|
|
-
|
|
I check Asset is now in Open state.
|
|
-
|
|
!assert {model: account.asset.asset, id: account_asset_asset_vehicles0, severity: error, string: Asset should be in Open state}:
|
|
- state == 'open'
|
|
-
|
|
I compute depreciation lines for asset of CEO's Car .
|
|
-
|
|
!python {model: account.asset.asset}: |
|
|
self.compute_depreciation_board(cr, uid, [ref("account_asset_asset_vehicles0")])
|
|
# pressing computation button can be remove if creation of depreciation lines while asset is created
|
|
value = self.browse(cr, uid, [ref("account_asset_asset_vehicles0")])[0]
|
|
assert value.method_number == len(value.depreciation_line_ids), 'Depreciation lines not created correctly'
|
|
-
|
|
I create account move for all depreciation lines.
|
|
-
|
|
!python {model: account.asset.depreciation.line}: |
|
|
ids = self.search(cr, uid, [('asset_id','=',ref('account_asset_asset_vehicles0'))])
|
|
self.create_move(cr, uid, ids)
|
|
-
|
|
I check the move line is created.
|
|
-
|
|
!python {model: account.asset.asset}: |
|
|
asset = self.browse(cr, uid, [ref("account_asset_asset_vehicles0")])[0]
|
|
assert len(asset.depreciation_line_ids) == len(asset.account_move_line_ids), 'Move lines not created correctly'
|
|
-
|
|
I Check that After creating all the moves of depreciation lines the state "Close".
|
|
-
|
|
!assert {model: account.asset.asset, id: account_asset_asset_vehicles0}:
|
|
- state == 'close'
|