[ADD]: Added res.config view to make it general.
bzr revid: uco@tinyerp.com-20120302085311-jtl8hl9inru6r0bz
This commit is contained in:
@@ -173,17 +173,14 @@ class res_config_configurable(osv.osv_memory):
|
||||
[('state','in',['to install', 'installed', 'to upgrade'])],
|
||||
context=context)
|
||||
modules_list = [mod.name for mod in module_obj.browse(cr, uid, module_ids, context=context)]
|
||||
for column in self._columns.keys():
|
||||
if module.startswith('module_'):
|
||||
module_names.append(module.strip('module_'))
|
||||
installed_modules = dict([(name, True) for name in list(set(modules_list) & set(module_names))])
|
||||
installed_modules = dict([('module_'+name, True) for name in modules_list])
|
||||
return installed_modules
|
||||
|
||||
def set_installed_modules(self, cr, uid, ids, vals, context=None):
|
||||
module_obj = self.pool.get('ir.module.module')
|
||||
for module, value in vals.items():
|
||||
if module.startswith('module_'):
|
||||
mod_name = module.strip('module_')
|
||||
mod_name = module[len('module_'):]
|
||||
installed = self.get_default_installed_modules(cr, uid, ids, context=context)
|
||||
if value == True and not installed.get(mod_name):
|
||||
module_id = module_obj.search(cr, uid, [('name','=',mod_name)])
|
||||
|
||||
@@ -84,6 +84,29 @@
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_config_view_for_all" model="ir.ui.view">
|
||||
<field name="name">res.config.view.all</field>
|
||||
<field name="model">res.config</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group col="4" colspan="4" name="sales">
|
||||
</group>
|
||||
<group col="4" colspan="4" name="crm">
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_sale_config" model="ir.actions.act_window">
|
||||
<field name="name">Configure Sales Application</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.config</field>
|
||||
<field name="view_id" ref="res_config_view_for_all"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user