From f51111f283a33bcd73e699b9bff82f951fd231b1 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 15 Dec 2009 15:08:41 +0100 Subject: [PATCH] [fix] profile_accounting: migrate to res.config-based initial configuration bzr revid: xmo@tinyerp.com-20091215140841-c93etyiidd6v04pk --- .../profile_accounting/profile_accounting.py | 30 +++--------- .../profile_accounting/profile_accounting.xml | 49 ++++++++++--------- 2 files changed, 32 insertions(+), 47 deletions(-) diff --git a/addons/profile_accounting/profile_accounting.py b/addons/profile_accounting/profile_accounting.py index 6d2eafc66b9..3b877c0c690 100644 --- a/addons/profile_accounting/profile_accounting.py +++ b/addons/profile_accounting/profile_accounting.py @@ -24,6 +24,8 @@ import pooler class profile_accounting_config_install_modules_wizard(osv.osv_memory): _name='profile.accounting.config.install_modules_wizard' + _inherit = 'res.config' + _columns = { 'name':fields.char('Name', size=64), 'account_analytic_analysis':fields.boolean('Analytic Accounting'), @@ -33,38 +35,18 @@ class profile_accounting_config_install_modules_wizard(osv.osv_memory): 'hr_timesheet_invoice':fields.boolean('Invoice on Analytic Entries'), 'account_budget':fields.boolean('Budgets', help="Helps you to manage financial and analytic budgets."), 'board_document':fields.boolean('Document Management',help= "The Document Management System of Open ERP allows you to store, browse, automatically index, search and preview all kind of documents (internal documents, printed reports, calendar system). It opens an FTP access for the users to easily browse association's document."), - - } - def action_cancel(self,cr,uid,ids,conect=None): - return { - 'view_type': 'form', - "view_mode": 'form', - 'res_model': 'ir.actions.configuration.wizard', - 'type': 'ir.actions.act_window', - 'target':'new', - } - - def action_install(self, cr, uid, ids, context=None): - result=self.read(cr,uid,ids) + def execute(self, cr, uid, ids, context=None): + result = self.read(cr, uid, ids) mod_obj = self.pool.get('ir.module.module') for res in result: for r in res: - if r<>'id' and res[r]: + if r != 'id' and res[r]: ids += mod_obj.search(cr, uid, [('name', '=', r)]) mod_obj.button_install(cr, uid, ids, context=context) cr.commit() - db, pool = pooler.restart_pool(cr.dbname,update_module=True) - return { - 'view_type': 'form', - "view_mode": 'form', - 'res_model': 'ir.actions.configuration.wizard', - 'type': 'ir.actions.act_window', - 'target':'new', - } - - + db, pool = pooler.restart_pool(cr.dbname, update_module=True) profile_accounting_config_install_modules_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_accounting/profile_accounting.xml b/addons/profile_accounting/profile_accounting.xml index ab82f8a69c6..e3d3c973405 100644 --- a/addons/profile_accounting/profile_accounting.xml +++ b/addons/profile_accounting/profile_accounting.xml @@ -5,25 +5,29 @@ Accounting Profile : Install extra modules profile.accounting.config.install_modules_wizard form + -
- - - - - - - - - - - -