From edf0e5730538b7f764371197c70d8acd4f97c0fc Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 5 Oct 2011 16:19:32 +0200 Subject: [PATCH] [FIX] base_setup: Use a new flag of the ir.module.category object for the listing of applications bzr revid: stw@openerp.com-20111005141932-mw8n1ccs1msino92 --- addons/base_setup/base_setup.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/base_setup/base_setup.py b/addons/base_setup/base_setup.py index 33837b5553b..9efc82f2d62 100644 --- a/addons/base_setup/base_setup.py +++ b/addons/base_setup/base_setup.py @@ -35,7 +35,7 @@ DEFAULT_MODULES = { 'Project Management' : ['project',], 'Knowledge Management' : ['document',], 'Warehouse Management' : ['stock',], - 'Manufacturing' : ['mrp',], + 'Manufacturing' : ['mrp', 'procurement'], 'Accounting & Finance' : ['account,'], 'Purchase Management' : ['purchase,'], 'Human Resources' : ['hr',], @@ -43,8 +43,6 @@ DEFAULT_MODULES = { 'Marketing' : ['marketing',], } -HIDDEN_CATEGORIES = ('Tools', 'System', 'Localization', 'Link', 'Uncategorized') - class base_setup_installer(osv.osv_memory): _name = 'base.setup.installer' @@ -63,7 +61,8 @@ class base_setup_installer(osv.osv_memory): fields = {} category_proxy = self.pool.get('ir.module.category') domain = [('parent_id', '=', False), - ('name', 'not in', HIDDEN_CATEGORIES )] + ('name', '!=', 'Uncategorized'), + ('visible', '=', True)] category_ids = category_proxy.search(cr, uid, domain, context=context) for category in category_proxy.browse(cr, uid, category_ids, context=context): category_name = 'category_%d' % (category.id,) @@ -79,11 +78,10 @@ class base_setup_installer(osv.osv_memory): for module in module_proxy.browse(cr, uid, module_ids, context=context): module_name = 'module_%d' % (module.id,) module_is_installed = module.state == 'installed' - title = "%s (%s)" % (module.shortdesc, module.complexity,) fields[module_name] = { 'type' : 'boolean', - 'string' : title, + 'string' : module.shortdesc, 'name' : module_name, 'help' : module.description, } @@ -105,7 +103,8 @@ class base_setup_installer(osv.osv_memory): result['module_%d' % (module.id,)] = module.state == 'installed' category_name = 'category_%d' % (module.category_id.id,) if not result.get('category_name'): - result[category_name] = module.state == 'installed' + result[category_name] = module.state == 'installed' and \ + module.category_id.name in DEFAULT_MODULES return result @@ -121,7 +120,8 @@ class base_setup_installer(osv.osv_memory): module_category_proxy = self.pool.get('ir.module.category') domain = [('parent_id', '=', False), - ('name', 'not in', HIDDEN_CATEGORIES)] + ('name', '!=', 'Uncategorized'), + ('visible', '=', True)] module_category_ids = module_category_proxy.search(cr, uid, domain, context=context, order='sequence asc') arch = ['
' % _('Automatic Base Setup')]