diff --git a/addons/account_asset/__openerp__.py b/addons/account_asset/__openerp__.py index 4cad6f74af3..0c761d04492 100755 --- a/addons/account_asset/__openerp__.py +++ b/addons/account_asset/__openerp__.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -25,7 +25,7 @@ "depends" : ["account"], "author" : "Tiny", "description": """Financial and accounting asset management. - This Module manages the assets owned by a company or an individual. It will keep track of depreciation's occurred on + This Module manages the assets owned by a company or an individual. It will keep track of depreciation's occurred on those assets. And it allows to create Move's of the depreciation lines. """, "website" : "http://www.openerp.com", @@ -42,10 +42,11 @@ "account_asset_wizard.xml", "wizard/account_asset_change_duration_view.xml", "wizard/wizard_asset_compute_view.xml", +# "wizard/wizard_asset_close_view.xml", "account_asset_view.xml", "account_asset_invoice_view.xml", "report/account_asset_report_view.xml", - + ], "active": False, "installable": True, diff --git a/addons/account_asset/wizard/wizard_asset_close.py b/addons/account_asset/wizard/wizard_asset_close.py index 0d274585036..fb595af5df0 100755 --- a/addons/account_asset/wizard/wizard_asset_close.py +++ b/addons/account_asset/wizard/wizard_asset_close.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,37 +15,25 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## -import wizard -import pooler +from osv import osv, fields -asset_end_arch = ''' -
- -''' +class wizard_asset_close(osv.osv_memory): + _name = 'account.asset.close' + _description = 'Close Asset' -asset_end_fields = { -} - -class wizard_asset_close(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result': {'type':'form', 'arch':asset_end_arch, 'fields':asset_end_fields, 'state':[ - ('end','Cancel'), - ('asset_close','End of asset') - ]} - }, - 'asset_close': { - 'actions': [], - 'result': {'type' : 'state', 'state': 'end'} - } - } -wizard_asset_close('account.asset.close') + def asset_close(self, cr, uid, ids, context=None): +# TODO: Need to improve +# asset_obj = self.pool.get('account.asset.asset') +# asset_ids = context and context.get('active_ids') or [] +# for asset in asset_obj.browse(cr, uid, asset_ids, context=context): +# if asset.state == 'open': +# asset_obj.set_to_close(cr, uid, asset.id, context=context) + return {'type': 'ir.actions.act_window_close'} +wizard_asset_close() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/account_asset/wizard/wizard_asset_close_view.xml b/addons/account_asset/wizard/wizard_asset_close_view.xml new file mode 100644 index 00000000000..8da5ab57593 --- /dev/null +++ b/addons/account_asset/wizard/wizard_asset_close_view.xml @@ -0,0 +1,34 @@ + + + + + + account.asset.close.wizard + account.asset.close + form + +
+ +