diff options
| author | Stephane Wirtel <stw@openerp.com> | 2011-10-06 15:09:09 +0200 |
|---|---|---|
| committer | Stephane Wirtel <stw@openerp.com> | 2011-10-06 15:09:09 +0200 |
| commit | eab1356855f10bd1c87ba49304ef5b9e5d729d58 (patch) | |
| tree | 2098b058ca093c833d5798da9656e2ed466c674c /addons/base_setup/base_setup.py | |
| parent | 84a94d7ec9cc32c3bbf2f5351e2ba661320d5bdc (diff) | |
[FIX] base_setup: Set the right modules of the category
bzr revid: stw@openerp.com-20111006130909-9sqjw6mgnldeammf
Diffstat (limited to 'addons/base_setup/base_setup.py')
| -rw-r--r-- | addons/base_setup/base_setup.py | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/addons/base_setup/base_setup.py b/addons/base_setup/base_setup.py index 9519644675b..4178a5140a8 100644 --- a/addons/base_setup/base_setup.py +++ b/addons/base_setup/base_setup.py @@ -36,8 +36,8 @@ DEFAULT_MODULES = { 'Knowledge Management' : ['document',], 'Warehouse Management' : ['stock',], 'Manufacturing' : ['mrp', 'procurement'], - 'Accounting & Finance' : ['account,'], - 'Purchase Management' : ['purchase,'], + 'Accounting & Finance' : ['account'], + 'Purchase Management' : ['purchase'], 'Human Resources' : ['hr',], 'Point of Sales' : ['pos',], 'Marketing' : ['marketing',], @@ -286,15 +286,26 @@ class base_setup_installer(osv.osv_memory): ir_module_module_dependency d inner join ir_module_module m2 on d.name = m2.name \ where d.module_id=m.id and m2.state in %s ) and state = %s", (category_id[1], ('installed', 'to install', 'to upgrade', ), 'uninstalled',)) - modules = [name for _, name in cr.fetchall()] + inner_modules = [name for _, name in cr.fetchall()] - module_ids = proxy.search(cr, uid, [('name', 'in', modules)], context=context) + module_ids = proxy.search(cr, uid, [('name', 'in', inner_modules)], context=context) if not module_ids: break + modules = modules + set(inner_modules) + proxy.state_update(cr, uid, module_ids, 'to install', ['uninstalled'], context=context) need_update = True + + domain = [('name', 'in', list(modules)), + ('state', '=', 'installed')] + for module in proxy.browse(cr, uid, proxy.search(cr, uid, domain, context=context), context): + cr.execute("update ir_actions_todo set state='open' \ + from ir_model_data as data where data.res_id = ir_actions_todo.id \ + and ir_actions_todo.type='special'\ + and data.model = 'ir.actions.todo' and data.module=%s", (module.name, )) + if need_update: cr.commit() self.pool = pooler.restart_pool(cr.dbname, update_module=True)[1] @@ -304,33 +315,6 @@ class base_setup_installer(osv.osv_memory): else: return {'type' : 'ir.actions.act_window_close'} - # TODO: To implement in this new wizard - #def execute(self, cr, uid, ids, context=None): - # module_pool = self.pool.get('ir.module.module') - # modules_selected = [] - # datas = self.read(cr, uid, ids, context=context)[0] - # for mod in datas.keys(): - # if mod in ('id', 'progress'): - # continue - # if datas[mod] == 1: - # modules_selected.append(mod) - - # module_ids = module_pool.search(cr, uid, [('name', 'in', modules_selected)], context=context) - # need_install = False - # for module in module_pool.browse(cr, uid, module_ids, context=context): - # if module.state == 'uninstalled': - # module_pool.state_update(cr, uid, [module.id], 'to install', ['uninstalled'], context) - # need_install = True - # cr.commit() - # elif module.state == 'installed': - # cr.execute("update ir_actions_todo set state='open' \ - # from ir_model_data as data where data.res_id = ir_actions_todo.id \ - # and ir_actions_todo.type='special'\ - # and data.model = 'ir.actions.todo' and data.module=%s", (module.name, )) - # if need_install: - # self.pool = pooler.restart_pool(cr.dbname, update_module=True)[1] - # return - #Migrate data from another application Conf wiz class migrade_application_installer_modules(osv.osv_memory): |
