[IMP] cleanup base_setup_installer's installations in case of simple view
* Use hook methods instead of overriding modules_to_install * Get view state via res.users.views instead of trying to fetch res.config.view which might not exist at all bzr revid: xmo@openerp.com-20100809081732-mkpns45aydt7z0rp
This commit is contained in:
parent
da1b9356ba
commit
10b23a478f
|
@ -91,24 +91,21 @@ class base_setup_installer(osv.osv_memory):
|
||||||
'crm': True,
|
'crm': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def _if_mrp(self, cr, uid, ids, context=None):
|
||||||
|
if self.pool.get('res.users').browse(cr, uid, uid, context=context)\
|
||||||
|
.view == 'simple':
|
||||||
|
return ['mrp_jit']
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _if_knowledge(self, cr, uid, ids, context=None):
|
||||||
|
if self.pool.get('res.users').browse(cr, uid, uid, context=context)\
|
||||||
|
.view == 'simple':
|
||||||
|
return ['document_ftp']
|
||||||
|
return None
|
||||||
|
|
||||||
def onchange_moduleselection(self, cr, uid, ids, *args):
|
def onchange_moduleselection(self, cr, uid, ids, *args):
|
||||||
progress = self._progress(cr, uid) - round((len(filter(lambda x: x==1, args)))*80/len(args))
|
progress = self._progress(cr, uid) - round((len(filter(lambda x: x==1, args)))*80/len(args))
|
||||||
if progress <= 10.0:
|
if progress <= 10.0:
|
||||||
progress = 10.0
|
progress = 10.0
|
||||||
return {'value':{'progress':progress}}
|
return {'value':{'progress':progress}}
|
||||||
|
|
||||||
def modules_to_install(self, cr, uid, ids, context=None):
|
|
||||||
modules = super(base_setup_installer, self).modules_to_install(cr, uid, ids, context=context)
|
|
||||||
interface_id = self.pool.get('res.config.view').search(cr, uid, [])
|
|
||||||
interface = self.pool.get('res.config.view').read(cr, uid, interface_id)[0]
|
|
||||||
modules_selected = self.read(cr, uid, ids)[0]
|
|
||||||
added_modules = []
|
|
||||||
if interface.get('view', '') == 'simple' :
|
|
||||||
if modules_selected.get('mrp', False):
|
|
||||||
added_modules.append('mrp_jit')
|
|
||||||
if modules_selected.get('knowledge', False):
|
|
||||||
added_modules.append('document_ftp')
|
|
||||||
return modules | set(added_modules)
|
|
||||||
base_setup_installer()
|
base_setup_installer()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue