From 0bf0ceebee6cb5a8a7f758c317457ddda733f3ed Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 15 Dec 2009 16:23:11 +0100 Subject: [PATCH] [fix] profile_service: migrate to res.config-based initial configuration bzr revid: xmo@tinyerp.com-20091215152311-sb4cxygms426bftf --- addons/profile_service/profile_service.py | 24 ++------- addons/profile_service/profile_service.xml | 58 ++++++++++++---------- 2 files changed, 36 insertions(+), 46 deletions(-) diff --git a/addons/profile_service/profile_service.py b/addons/profile_service/profile_service.py index 48236901d90..1b5195b9099 100644 --- a/addons/profile_service/profile_service.py +++ b/addons/profile_service/profile_service.py @@ -24,6 +24,7 @@ import pooler class profile_service_config_install_modules_wizard(osv.osv_memory): _name='profile.service.config.install_modules_wizard' + _inherit = 'res.config' _rec_name = 'crm_configuration' _columns = { 'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."), @@ -46,31 +47,16 @@ class profile_service_config_install_modules_wizard(osv.osv_memory): help="An integrated wiki content management system. This is really "\ "usefull to manage FAQ, quality manuals, etc.") } - 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) + 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', - } profile_service_config_install_modules_wizard() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_service/profile_service.xml b/addons/profile_service/profile_service.xml index e1533ead011..94a967d1840 100644 --- a/addons/profile_service/profile_service.xml +++ b/addons/profile_service/profile_service.xml @@ -5,32 +5,37 @@ Service Profile : Install extra modules profile.service.config.install_modules_wizard form + -
- - - - - - - - - - - - - - - - - - -