diff options
| author | Yannick Tivisse <yti@odoo.com> | 2020-01-31 14:11:36 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-03-05 14:03:45 +0000 |
| commit | 4c291e3f7049c3af859902a6f5857eab68be2f9e (patch) | |
| tree | f05360b1d701cc921bedbf7d8df385838bd4bba2 /odoo | |
| parent | 4f1fa7e24ce720167da4d1048edf8d6c13b4c520 (diff) | |
[IMP] base: Display searchpanel on ir.module.module views
Purpose
=======
The current kanban view is messy. It is difficult to identify which
apps are installed or not. The user can completely miss a module
that might have interested him. A search panel would make things way
more readable.
closes odoo/odoo#44401
Taskid: 2181557
Related: odoo/enterprise#8144
Related: odoo/upgrade#879
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'odoo')
25 files changed, 70 insertions, 28 deletions
diff --git a/odoo/addons/base/data/ir_module_category_data.xml b/odoo/addons/base/data/ir_module_category_data.xml index 23b941e4e6d..602eaa4c22f 100644 --- a/odoo/addons/base/data/ir_module_category_data.xml +++ b/odoo/addons/base/data/ir_module_category_data.xml @@ -2,14 +2,19 @@ <odoo> <data> <record model="ir.module.category" id="module_category_hidden"> - <field name="name">Technical Settings</field> + <field name="name">Technical</field> <field name="sequence">0</field> <field name="visible" eval="0" /> </record> - <record model="ir.module.category" id="module_category_localization"> + <record model="ir.module.category" id="module_category_accounting"> + <field name="name">Accounting</field> + </record> + + <record model="ir.module.category" id="module_category_accounting_localizations"> <field name="name">Localization</field> <field name="visible" eval="0" /> + <field name="parent_id" ref="module_category_accounting"/> </record> <record model="ir.module.category" id="module_category_payroll_localization"> @@ -18,7 +23,7 @@ </record> <record model="ir.module.category" id="module_category_localization_account_charts"> - <field name="parent_id" ref="module_category_localization" /> + <field name="parent_id" ref="module_category_accounting_localizations" /> <field name="name">Account Charts</field> <field name="visible" eval="0" /> </record> diff --git a/odoo/addons/base/data/ir_module_module.xml b/odoo/addons/base/data/ir_module_module.xml index 62a5feaaf10..4ef48995f42 100644 --- a/odoo/addons/base/data/ir_module_module.xml +++ b/odoo/addons/base/data/ir_module_module.xml @@ -20,7 +20,7 @@ <field name="name">timesheet_grid</field> <field name="shortdesc">Timesheets</field> <field name="sequence">11</field> - <field name="category_id" ref="base.module_category_operations_timesheets"/> + <field name="category_id" ref="base.module_category_services_timesheets"/> <field name="application" eval="True"/> <field name="summary">Track time & costs</field> <field name="license">OEEL-1</field> @@ -129,7 +129,7 @@ <record model="ir.module.module" id="base.module_project_forecast"> <field name="name">project_forecast</field> <field name="shortdesc">Project Forecast</field> - <field name="category_id" ref="base.module_category_operations_project"/> + <field name="category_id" ref="base.module_category_services_project"/> <field name="application" eval="True"/> <field name="summary">Project forecasts, resource allocation</field> <field name="license">OEEL-1</field> @@ -169,7 +169,7 @@ <field name="name">stock_barcode</field> <field name="shortdesc">Barcode</field> <field name="sequence">14</field> - <field name="category_id" ref="base.module_category_operations_inventory"/> + <field name="category_id" ref="base.module_category_inventory_inventory"/> <field name="application" eval="True"/> <field name="summary">Barcode scanner for warehouses</field> <field name="license">OEEL-1</field> diff --git a/odoo/addons/base/models/ir_module.py b/odoo/addons/base/models/ir_module.py index b10ca516f74..f042dd5aa7b 100644 --- a/odoo/addons/base/models/ir_module.py +++ b/odoo/addons/base/models/ir_module.py @@ -151,7 +151,7 @@ class Module(models.Model): _name = "ir.module.module" _rec_name = "shortdesc" _description = "Module" - _order = 'sequence,name' + _order = 'application desc,sequence,name' @api.model def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False): @@ -907,6 +907,40 @@ class Module(models.Model): for module in self.sudo().search([('state', '=', 'installed')]) } + @api.model + def search_panel_select_range(self, field_name): + if field_name == 'category_id': + domain = [('module_ids', '!=', False)] + + excluded_xmlids = [ + 'base.module_category_website_theme', + 'base.module_category_theme', + ] + if not self.user_has_groups('base.group_no_one'): + excluded_xmlids.append('base.module_category_hidden') + + excluded_category_ids = [] + for excluded_xmlid in excluded_xmlids: + categ = self.env.ref(excluded_xmlid, False) + if not categ: + continue + excluded_category_ids.append(categ.id) + + if excluded_category_ids: + domain = expression.AND([domain, [ + ('id', 'not in', excluded_category_ids), + ('parent_id', 'not in', excluded_category_ids), + ]]) + categories = self.env['ir.module.category'].search(domain) + categories = categories | categories.mapped('parent_id') + return { + 'parent_field': 'parent_id', + 'values': self.env['ir.module.category'].search_read( + [('id', 'in', categories.ids)], + ['display_name', 'parent_id']), + } + return super(Module, self).search_panel_select_range(field_name) + DEP_STATES = STATES + [('unknown', 'Unknown')] diff --git a/odoo/addons/base/views/ir_module_views.xml b/odoo/addons/base/views/ir_module_views.xml index 3a8021e07d1..3c570601431 100644 --- a/odoo/addons/base/views/ir_module_views.xml +++ b/odoo/addons/base/views/ir_module_views.xml @@ -48,6 +48,9 @@ <filter string="Category" name="category" domain="[]" context="{'group_by':'category_id'}"/> <filter string="State" name="state" domain="[]" context="{'group_by':'state'}"/> </group> + <searchpanel> + <field name="category_id" groupby="parent_id" string="Categories"/> + </searchpanel> </search> </field> </record> diff --git a/odoo/addons/test_access_rights/__manifest__.py b/odoo/addons/test_access_rights/__manifest__.py index 0b15fe2830e..e9269ea2175 100644 --- a/odoo/addons/test_access_rights/__manifest__.py +++ b/odoo/addons/test_access_rights/__manifest__.py @@ -2,7 +2,7 @@ 'name': 'test of access rights and rules', 'description': "Testing of access restrictions", 'version': '0.0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'data': [ 'ir.model.access.csv', 'security.xml', diff --git a/odoo/addons/test_action_bindings/__manifest__.py b/odoo/addons/test_action_bindings/__manifest__.py index b64e92753fd..3f194aeca4a 100644 --- a/odoo/addons/test_action_bindings/__manifest__.py +++ b/odoo/addons/test_action_bindings/__manifest__.py @@ -1,6 +1,6 @@ { 'name': "Test Action Bindings", - 'category': 'Tests', + 'category': 'Hidden/Tests', 'data': [ 'ir.model.access.csv', 'test_data.xml', diff --git a/odoo/addons/test_assetsbundle/__manifest__.py b/odoo/addons/test_assetsbundle/__manifest__.py index 381354ea25d..42a67935b50 100644 --- a/odoo/addons/test_assetsbundle/__manifest__.py +++ b/odoo/addons/test_assetsbundle/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'test-assetsbundle', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to verify the Assets Bundle mechanism.""", 'maintainer': 'Odoo SA', 'depends': ['base'], diff --git a/odoo/addons/test_convert/__manifest__.py b/odoo/addons/test_convert/__manifest__.py index c12f91b2f9a..f316a2df6ef 100644 --- a/odoo/addons/test_convert/__manifest__.py +++ b/odoo/addons/test_convert/__manifest__.py @@ -5,7 +5,7 @@ 'name': 'test_convert', 'description': "Data for xml conversion tests", 'version': '0.0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'data': [ 'ir.model.access.csv', ] diff --git a/odoo/addons/test_converter/__manifest__.py b/odoo/addons/test_converter/__manifest__.py index 2b5a1652927..bc987f600ae 100644 --- a/odoo/addons/test_converter/__manifest__.py +++ b/odoo/addons/test_converter/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'test-field-converter', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """Tests of field conversions""", 'maintainer': 'OpenERP SA', 'depends': ['base'], diff --git a/odoo/addons/test_documentation_examples/__manifest__.py b/odoo/addons/test_documentation_examples/__manifest__.py index 6338847c7ca..d4ebde97c91 100644 --- a/odoo/addons/test_documentation_examples/__manifest__.py +++ b/odoo/addons/test_documentation_examples/__manifest__.py @@ -8,7 +8,7 @@ syntax-checked and tested. """, - 'category': 'Tests', + 'category': 'Hidden/Tests', 'version': '0.1', 'data': [ 'ir.model.access.csv', diff --git a/odoo/addons/test_exceptions/__manifest__.py b/odoo/addons/test_exceptions/__manifest__.py index 257ed67b829..3f3cf06a05e 100644 --- a/odoo/addons/test_exceptions/__manifest__.py +++ b/odoo/addons/test_exceptions/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'test-exceptions', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to generate exceptions.""", 'depends': ['base'], 'data': ['view.xml', 'ir.model.access.csv'], diff --git a/odoo/addons/test_impex/__manifest__.py b/odoo/addons/test_impex/__manifest__.py index 4ace0a66a53..786b3165ae5 100644 --- a/odoo/addons/test_impex/__manifest__.py +++ b/odoo/addons/test_impex/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'test-import-export', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to test import/export.""", 'depends': ['base'], 'data': ['ir.model.access.csv'], diff --git a/odoo/addons/test_inherit/__manifest__.py b/odoo/addons/test_inherit/__manifest__.py index 5387ca6c99e..a5031057584 100644 --- a/odoo/addons/test_inherit/__manifest__.py +++ b/odoo/addons/test_inherit/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'test-inherit', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to verify the inheritance.""", 'depends': ['base', 'test_new_api'], 'data': [ diff --git a/odoo/addons/test_inherits/__manifest__.py b/odoo/addons/test_inherits/__manifest__.py index 21010738f8e..6a1bffb4b20 100644 --- a/odoo/addons/test_inherits/__manifest__.py +++ b/odoo/addons/test_inherits/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'test-inherits', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to verify the inheritance using _inherits.""", 'author': 'Camptocamp', 'website': 'http://www.camptocamp.com', diff --git a/odoo/addons/test_inherits_depends/__manifest__.py b/odoo/addons/test_inherits_depends/__manifest__.py index 335fdee1362..eb3cbad2a44 100644 --- a/odoo/addons/test_inherits_depends/__manifest__.py +++ b/odoo/addons/test_inherits_depends/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'test-inherits-depends', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to verify the inheritance using _inherits in non-original modules.""", 'depends': ['test_inherits'], 'data': [], diff --git a/odoo/addons/test_limits/__manifest__.py b/odoo/addons/test_limits/__manifest__.py index 0605331988b..427485f9ee6 100644 --- a/odoo/addons/test_limits/__manifest__.py +++ b/odoo/addons/test_limits/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'test-limits', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module with dummy methods.""", 'depends': ['base'], 'data': ['ir.model.access.csv'], diff --git a/odoo/addons/test_lint/__manifest__.py b/odoo/addons/test_lint/__manifest__.py index 29ee33ed7ea..247b80efd98 100644 --- a/odoo/addons/test_lint/__manifest__.py +++ b/odoo/addons/test_lint/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'test-lint', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to test Odoo code with various linters.""", 'maintainer': 'Odoo SA', 'depends': ['base'], diff --git a/odoo/addons/test_main_flows/__manifest__.py b/odoo/addons/test_main_flows/__manifest__.py index 7dcb3a7457e..7c8474e16c1 100644 --- a/odoo/addons/test_main_flows/__manifest__.py +++ b/odoo/addons/test_main_flows/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Test Main Flow', 'version': '1.0', - 'category': 'Tools', + 'category': 'Hidden/Tests', 'description': """ This module will test the main workflow of Odoo. It will install some main apps and will try to execute the most important actions. diff --git a/odoo/addons/test_mimetypes/__manifest__.py b/odoo/addons/test_mimetypes/__manifest__.py index dddcd3f57db..4cf8382dedf 100644 --- a/odoo/addons/test_mimetypes/__manifest__.py +++ b/odoo/addons/test_mimetypes/__manifest__.py @@ -2,6 +2,6 @@ { 'name': 'test mimetypes-guessing', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to generate exceptions.""", } diff --git a/odoo/addons/test_new_api/__manifest__.py b/odoo/addons/test_new_api/__manifest__.py index f7ba4e9cdd8..bd7e8f7fb69 100644 --- a/odoo/addons/test_new_api/__manifest__.py +++ b/odoo/addons/test_new_api/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Test API', 'version': '1.0', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to test the API.""", 'depends': ['base', 'web', 'web_tour'], 'installable': True, diff --git a/odoo/addons/test_read_group/__manifest__.py b/odoo/addons/test_read_group/__manifest__.py index 3b3bd4d4025..d96d2f102f8 100644 --- a/odoo/addons/test_read_group/__manifest__.py +++ b/odoo/addons/test_read_group/__manifest__.py @@ -3,7 +3,7 @@ 'name': "test read_group", 'description': "Tests for read_group", - 'category': 'Tests', + 'category': 'Hidden/Tests', 'version': '0.1', 'depends': ['base'], diff --git a/odoo/addons/test_rpc/__manifest__.py b/odoo/addons/test_rpc/__manifest__.py index 6e8e68926f9..6e90006db39 100644 --- a/odoo/addons/test_rpc/__manifest__.py +++ b/odoo/addons/test_rpc/__manifest__.py @@ -2,7 +2,7 @@ { "name": "Test RPC", "version": "1.0", - "category": "Tests", + "category": "Hidden/Tests", "description": """A module to test the RPC requests.""", "depends": ["base", "web"], "installable": True, diff --git a/odoo/addons/test_testing_utilities/__manifest__.py b/odoo/addons/test_testing_utilities/__manifest__.py index eb7731a7826..d24a151034e 100644 --- a/odoo/addons/test_testing_utilities/__manifest__.py +++ b/odoo/addons/test_testing_utilities/__manifest__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- { 'name': "Test testing utilities", - 'category': "Tests", + 'category': "Hidden/Tests", 'description': """Non-trivial testing utilities can require models & all This here module is useful to validate that they're doing what they're diff --git a/odoo/addons/test_translation_import/__manifest__.py b/odoo/addons/test_translation_import/__manifest__.py index c6de7e12509..bc20d0da61d 100644 --- a/odoo/addons/test_translation_import/__manifest__.py +++ b/odoo/addons/test_translation_import/__manifest__.py @@ -2,7 +2,7 @@ { 'name': 'test-translation-import', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to test translation import.""", 'depends': ['base'], 'data': [ diff --git a/odoo/addons/test_uninstall/__manifest__.py b/odoo/addons/test_uninstall/__manifest__.py index 899c1c6cab6..02ef3785888 100644 --- a/odoo/addons/test_uninstall/__manifest__.py +++ b/odoo/addons/test_uninstall/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'test-uninstall', 'version': '0.1', - 'category': 'Tests', + 'category': 'Hidden/Tests', 'description': """A module to test the uninstall feature.""", 'depends': ['base'], 'data': ['ir.model.access.csv'], |
