2
In order to test Account Asset I create Asset and confirm it and check it's Depriciation lines
4
I Create an Asset Category
6
!record {model: account.asset.category, id: account_asset_category_landbuildings0}:
7
account_asset_id: account.xfa
8
account_depreciation_id: account.xfa
9
account_expense_depreciation_id: account.a_expense
10
journal_id: account.expenses_journal
11
name: Land & Buildings
13
I Create an Account Asset
15
!record {model: account.asset.asset, id: account_asset_asset_Land0}:
16
category_id: account_asset_category_landbuildings0
19
partner_id: base.res_partner_14
20
purchase_value: 5000.0
23
I check Initially that Account Asset is in the "Draft" state
25
!assert {model: account.asset.asset, id: account_asset_asset_Land0}:
28
I Confirm Account Asset using Confirm Asset button
30
!python {model: account.asset.asset}: |
31
self.validate(cr, uid, [ref("account_asset_asset_Land0")])
33
I check Asset is in running state after pressing Confirm button on asset
35
!assert {model: account.asset.asset, id: account_asset_asset_Land0}:
38
I Compute Account Asset using Compute button and check the number of depreciation lines created
40
!python {model: account.asset.asset}: |
41
self.compute_depreciation_board(cr, uid, [ref("account_asset_asset_Land0")])
42
# pressing computation button can be remove if creation of depreciation lines while asset is created
43
value = self.browse(cr, uid, [ref("account_asset_asset_Land0")])[0]
44
assert value.method_number == len(value.depreciation_line_ids)
46
I Create Account Move using create move button on depreciation lines
48
!python {model: account.asset.depreciation.line}: |
49
ids = self.search(cr, uid, [('asset_id','=',ref('account_asset_asset_Land0'))])
50
self.create_move(cr, uid, ids)
52
I Check that After creating all the moves of depreciation lines the state is in "Close" state
54
!assert {model: account.asset.asset, id: account_asset_asset_Land0}: