Bharat Devnani (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-account-asset-yml_testing-bde into
lp:~openerp-dev/openobject-addons/trunk-account-asset.
Requested reviews:
OpenERP R&D Team (openerp-dev)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account-asset-yml_testing-bde/+merge/66300
Hello Sir,
I have added the YML Test Case. the close state test case is failing in this
branch as in this branch there are only two states : draft and running , but
the close state feature is available in the other branch, when that branch will
merge in the addons the close state test case will also work.
Thanks & Regards,
Devnani Bharat R.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account-asset-yml_testing-bde/+merge/66300
Your team OpenERP R&D Team is requested to review the proposed merge of
lp:~openerp-dev/openobject-addons/trunk-account-asset-yml_testing-bde into
lp:~openerp-dev/openobject-addons/trunk-account-asset.
=== modified file 'account_asset/__openerp__.py'
--- account_asset/__openerp__.py 2011-05-09 09:51:57 +0000
+++ account_asset/__openerp__.py 2011-06-29 13:27:17 +0000
@@ -36,6 +36,8 @@
],
"demo_xml" : [
],
+ 'test': ['test/account_asset.yml',
+ ],
"update_xml" : [
"security/ir.model.access.csv",
"account_asset_wizard.xml",
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py 2011-06-23 15:15:03 +0000
+++ account_asset/account_asset.py 2011-06-29 13:27:17 +0000
@@ -116,9 +116,7 @@
old_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_id', '=', False)])
if old_depreciation_line_ids:
depreciation_lin_obj.unlink(cr, uid, old_depreciation_line_ids, context=context)
-
amount_to_depr = residual_amount = asset.value_residual
-
depreciation_date = datetime.strptime(self._get_last_depreciation_date(cr, uid, [asset.id], context)[asset.id], '%Y-%m-%d')
day = depreciation_date.day
month = depreciation_date.month
@@ -350,6 +348,7 @@
if period and (period.date_start<=date_start):
result += self._compute_move(cr, uid, property, period, context)
return result
+
account_asset_asset()
class account_asset_depreciation_line(osv.osv):
=== added directory 'account_asset/test'
=== added file 'account_asset/test/account_asset.yml'
--- account_asset/test/account_asset.yml 1970-01-01 00:00:00 +0000
+++ account_asset/test/account_asset.yml 2011-06-29 13:27:17 +0000
@@ -0,0 +1,68 @@
+-
+ In order to test Account Asset feature first i created Asset Category then Account Asset
+-
+ Creating a account.asset.category record
+-
+ !record {model: account.asset.category, id: account_asset_category_fixed_assets0}:
+ account_asset_id: account.xfa
+ account_depreciation_id: account.xfa
+ account_expense_depreciation_id: account.a_recv
+ company_id: base.main_company
+ journal_id: account.bank_journal
+ method: linear
+ method_time: delay
+ name: Fixed Assets
+
+-
+ Creating a account.asset.asset record
+-
+ !record {model: account.asset.asset, id: account_asset_asset_car0}:
+ category_id: account_asset_category_fixed_assets0
+ code: a
+ company_id: base.main_company
+ currency_id: base.EUR
+ method: linear
+ method_time: delay
+ method_delay: 5
+ method_period: 12
+ name: Car
+ partner_id: base.res_partner_14
+ period_id: account.period_6
+ purchase_date: '2011-06-29'
+ purchase_value: 5000.0
+ salvage_value: 2000.0
+ state: draft
+-
+ I check that Initially Account Asset is in the "Draft" state
+-
+ !assert {model: account.asset.asset, id: account_asset_asset_car0}:
+ - state == 'draft'
+-
+ I Confirm Account Asset using Confirm Asset button
+-
+ !python {model: account.asset.asset}: |
+ self.validate(cr, uid, [ref("account_asset_asset_car0")])
+-
+ I compute Account Asset using Compute button and check the number of depreciation lines created are proper
+-
+ !python {model: account.asset.asset}: |
+ self.compute_depreciation_board(cr, uid, [ref("account_asset_asset_car0")])
+ for value in self.browse(cr, uid, [ref("account_asset_asset_car0")]):
+ assert value.method_delay == len(value.depreciation_line_ids)
+-
+ I Create Account Asset Move using using create move method
+-
+ !python {model: account.asset.depreciation.line}: |
+ ids = self.search(cr, uid, [('asset_id','=',ref('account_asset_asset_car0'))])
+ self.create_move(cr, uid, ids)
+-
+ I check that After creating all the moves of asset the state is in "Close" state
+-
+ !assert {model: account.asset.asset, id: account_asset_asset_car0}:
+ - state == 'close'
+-
+ I check that after the state is closed the rsidual value becomes 0
+-
+ !assert {model: account.asset.asset, id: account_asset_asset_car0}:
+ - value_residual == 0.0
+
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp