diff --git a/hide_filters_groupby/README.rst b/hide_filters_groupby/README.rst new file mode 100644 index 000000000..d0fbc2f5c --- /dev/null +++ b/hide_filters_groupby/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Hide Filters Groupby +===================== +Hide Filters Groupby helps you to hide filter and group by option. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developers: (V16): Rahul Rajeev , Jumana jabin MP + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/hide_filters_groupby/__init__.py b/hide_filters_groupby/__init__.py new file mode 100644 index 000000000..db60e55cf --- /dev/null +++ b/hide_filters_groupby/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from . import models diff --git a/hide_filters_groupby/__manifest__.py b/hide_filters_groupby/__manifest__.py new file mode 100644 index 000000000..88030b1e8 --- /dev/null +++ b/hide_filters_groupby/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +{ + 'name': 'Hide Filters GroupBy', + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Hide Filters GroupBy Helps You to Hide Filter And' + ' GroupBy Option.', + 'description': 'Hide Filters GroupBy Helps you to Hide Filter and' + ' Group by Option on the Basis of Globally or Custom. On ' + 'Choosing Option Globally Filter and Group by Option of' + ' all Models will be Hide and on Choosing Option Custom,' + ' Filter and Group by Option of all Selected Models will' + ' be Hidden.', + 'author': 'Cybrosys Techno solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'base_setup'], + 'data': [ + 'views/res_config_settings_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'hide_filters_groupby/static/src/css/hide_filters_groupby.css', + 'hide_filters_groupby/static/src/js/control_panel.js', + 'hide_filters_groupby/static/src/js/search_model.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/hide_filters_groupby/doc/RELEASE_NOTES.md b/hide_filters_groupby/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..1560593ff --- /dev/null +++ b/hide_filters_groupby/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.08.2023 +#### Version 16.0.1.0.0 +#### ADD + - Initial Commit for Hide Filters GroupBy diff --git a/hide_filters_groupby/models/__init__.py b/hide_filters_groupby/models/__init__.py new file mode 100644 index 000000000..bc420c25e --- /dev/null +++ b/hide_filters_groupby/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from . import ir_http +from . import res_config_settings diff --git a/hide_filters_groupby/models/ir_http.py b/hide_filters_groupby/models/ir_http.py new file mode 100644 index 000000000..e36f110d6 --- /dev/null +++ b/hide_filters_groupby/models/ir_http.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from odoo import models + + +class IrHttp(models.AbstractModel): + """This class is used to add additional functionality to the 'ir.http' + model. It inherits from the models.AbstractModel' class, allowing it to + extend the behavior of the 'ir.http' model.""" + _inherit = 'ir.http' + + def session_info(self): + """Get additional session information.""" + res = super(IrHttp, self).session_info() + res['hide_filters_groupby'] = self.env['ir.config_parameter'] \ + .sudo().get_param('hide_filters_groupby.hide_filters_groupby') + res['ir_model_ids'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'hide_filters_groupby.ir_model_ids') + res['is_hide_filters_groupby_enabled'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'hide_filters_groupby.is_hide_filters_groupby_enabled') + return res diff --git a/hide_filters_groupby/models/res_config_settings.py b/hide_filters_groupby/models/res_config_settings.py new file mode 100644 index 000000000..87b49faaa --- /dev/null +++ b/hide_filters_groupby/models/res_config_settings.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2022-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################### +from ast import literal_eval +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + """Inheriting ResConfigSettings Model""" + _inherit = 'res.config.settings' + + is_hide_filters_groupby_enabled = fields.Boolean( + string='Hide Filters and Group By Enabled', default=False, + config_parameter='hide_filters_groupby.is_hide_filters_groupby_enabled', + help='If set to True, it enables hiding filters and group by globally.') + hide_filters_groupby = fields.Selection(selection=[ + ('global', 'Globally'), ('custom', 'Custom'), ], + string='Hide Filters and Group By', default='global', + config_parameter='hide_filters_groupby.hide_filters_groupby', + help='Choose the option to hide filters and group by globally or' + ' use custom settings.') + ir_model_ids = fields.Many2many('ir.model', + 'res_config_ir_model_rel', + 'res_config', 'model', + string='Models', + help='Models that are affected by the ' + 'hide filters and group by settings.') + + def set_values(self): + """Update the values of the configuration settings""" + res = super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param( + 'hide_filters_groupby.ir_model_ids', self.ir_model_ids.ids) + return res + + def get_values(self): + """Get the current values for the configuration settings""" + res = super(ResConfigSettings, self).get_values() + ir_model_ids = self.env['ir.config_parameter'].sudo().get_param( + 'hide_filters_groupby.ir_model_ids') + res.update( + ir_model_ids=literal_eval(ir_model_ids) if ir_model_ids else False) + return res diff --git a/hide_filters_groupby/static/description/assets/icons/check.png b/hide_filters_groupby/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/check.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/chevron.png b/hide_filters_groupby/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/chevron.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/cogs.png b/hide_filters_groupby/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/cogs.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/consultation.png b/hide_filters_groupby/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/consultation.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/ecom-black.png b/hide_filters_groupby/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/ecom-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/education-black.png b/hide_filters_groupby/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/education-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/hotel-black.png b/hide_filters_groupby/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/hotel-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/license.png b/hide_filters_groupby/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/license.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/lifebuoy.png b/hide_filters_groupby/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/lifebuoy.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/manufacturing-black.png b/hide_filters_groupby/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/manufacturing-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/pos-black.png b/hide_filters_groupby/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/pos-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/puzzle.png b/hide_filters_groupby/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/puzzle.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/restaurant-black.png b/hide_filters_groupby/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/restaurant-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/service-black.png b/hide_filters_groupby/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/service-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/trading-black.png b/hide_filters_groupby/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/trading-black.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/training.png b/hide_filters_groupby/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/training.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/update.png b/hide_filters_groupby/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/update.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/user.png b/hide_filters_groupby/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/user.png differ diff --git a/hide_filters_groupby/static/description/assets/icons/wrench.png b/hide_filters_groupby/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/hide_filters_groupby/static/description/assets/icons/wrench.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/categories.png b/hide_filters_groupby/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/categories.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/check-box.png b/hide_filters_groupby/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/check-box.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/compass.png b/hide_filters_groupby/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/compass.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/corporate.png b/hide_filters_groupby/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/corporate.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/customer-support.png b/hide_filters_groupby/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/customer-support.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/cybrosys-logo.png b/hide_filters_groupby/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/cybrosys-logo.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/features.png b/hide_filters_groupby/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/features.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/logo.png b/hide_filters_groupby/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/logo.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/pictures.png b/hide_filters_groupby/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/pictures.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/pie-chart.png b/hide_filters_groupby/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/pie-chart.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/right-arrow.png b/hide_filters_groupby/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/right-arrow.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/star.png b/hide_filters_groupby/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/star.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/support.png b/hide_filters_groupby/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/support.png differ diff --git a/hide_filters_groupby/static/description/assets/misc/whatsapp.png b/hide_filters_groupby/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/misc/whatsapp.png differ diff --git a/hide_filters_groupby/static/description/assets/modules/16.png b/hide_filters_groupby/static/description/assets/modules/16.png new file mode 100644 index 000000000..d9374733c Binary files /dev/null and b/hide_filters_groupby/static/description/assets/modules/16.png differ diff --git a/hide_filters_groupby/static/description/assets/modules/cost.png b/hide_filters_groupby/static/description/assets/modules/cost.png new file mode 100644 index 000000000..16a8a156a Binary files /dev/null and b/hide_filters_groupby/static/description/assets/modules/cost.png differ diff --git a/hide_filters_groupby/static/description/assets/modules/menu.png b/hide_filters_groupby/static/description/assets/modules/menu.png new file mode 100644 index 000000000..2c8fbb83f Binary files /dev/null and b/hide_filters_groupby/static/description/assets/modules/menu.png differ diff --git a/hide_filters_groupby/static/description/assets/modules/print.png b/hide_filters_groupby/static/description/assets/modules/print.png new file mode 100644 index 000000000..ac15216fb Binary files /dev/null and b/hide_filters_groupby/static/description/assets/modules/print.png differ diff --git a/hide_filters_groupby/static/description/assets/modules/show.png b/hide_filters_groupby/static/description/assets/modules/show.png new file mode 100644 index 000000000..ae32f480b Binary files /dev/null and b/hide_filters_groupby/static/description/assets/modules/show.png differ diff --git a/hide_filters_groupby/static/description/assets/modules/website.jpg b/hide_filters_groupby/static/description/assets/modules/website.jpg new file mode 100644 index 000000000..291635d04 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/modules/website.jpg differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/1.png b/hide_filters_groupby/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..7080e1853 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/1.png differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/2.png b/hide_filters_groupby/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..4a4ee26b8 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/2.png differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/3.png b/hide_filters_groupby/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..2873ecff4 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/3.png differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/4.png b/hide_filters_groupby/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8e6ec7f8e Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/4.png differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/5.png b/hide_filters_groupby/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..a25eb9e0a Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/5.png differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/6.png b/hide_filters_groupby/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..78c6bce57 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/6.png differ diff --git a/hide_filters_groupby/static/description/assets/screenshots/hero.gif b/hide_filters_groupby/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..228f7ec95 Binary files /dev/null and b/hide_filters_groupby/static/description/assets/screenshots/hero.gif differ diff --git a/hide_filters_groupby/static/description/banner.jpg b/hide_filters_groupby/static/description/banner.jpg new file mode 100644 index 000000000..2a198acaa Binary files /dev/null and b/hide_filters_groupby/static/description/banner.jpg differ diff --git a/hide_filters_groupby/static/description/icon.png b/hide_filters_groupby/static/description/icon.png new file mode 100644 index 000000000..f9b7d8c6c Binary files /dev/null and b/hide_filters_groupby/static/description/icon.png differ diff --git a/hide_filters_groupby/static/description/index.html b/hide_filters_groupby/static/description/index.html new file mode 100644 index 000000000..1d43ef66c --- /dev/null +++ b/hide_filters_groupby/static/description/index.html @@ -0,0 +1,641 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Hide Filters GroupBy

+

+ Hide Filters GroupBy Helps you to Hide Filter and GroupBy + Option.

+ + +
+
+
+
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Hide filters GroupBy Helps in the Globally or Custom Hide of the Filter + and GroupBy Options. When choosing a specific option, + selected models filter and groupby options will be hidden from view, + and when choosing a global option, all models filter and groupby + options will be hidden. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Hide Filter and GroupBy Option Globally. +
+
+
+
+ + Hide Filter and GroupBy Option for Custom Models. + +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Hide Filters and GroupBy +

+

+ Go to General Settings -> + Hide Filters and GroupBy + -> + Enable Hide Filters and GroupBy.

+ +

+ Choose Globally

+ +
+ +
+

+ Then Select a Model

+ +
+
+

+ Choose Custom Option . Select Custom Models

+ +

+ There We Can See The Filter and GroupBy Option is Hidden For + Selected Models.

+ +
+
+
+ + + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/hide_filters_groupby/static/src/css/hide_filters_groupby.css b/hide_filters_groupby/static/src/css/hide_filters_groupby.css new file mode 100644 index 000000000..fddf3d45b --- /dev/null +++ b/hide_filters_groupby/static/src/css/hide_filters_groupby.css @@ -0,0 +1,3 @@ +.o_control_panel .o_cp_bottom_right{ + justify-content: right; +} diff --git a/hide_filters_groupby/static/src/js/control_panel.js b/hide_filters_groupby/static/src/js/control_panel.js new file mode 100644 index 000000000..7851b2c6b --- /dev/null +++ b/hide_filters_groupby/static/src/js/control_panel.js @@ -0,0 +1,87 @@ +/** @odoo-module **/ +/** + * This module contains JavaScript code that is used to customize the behavior of the Control Panel + * in the Odoo web interface. It includes patches to hide filter and groupby options based on + * the global or custom settings. + */ +import session from 'web.session'; +import { ControlPanel } from "@web/search/control_panel/control_panel"; +import { useService } from "@web/core/utils/hooks"; +import { useState, onMounted, useExternalListener, useRef, useEffect } from "@odoo/owl"; +import { patch } from "@web/core/utils/patch"; +//This patch is used to hide filter and groupby option on the basis of globally or custom +patch(ControlPanel.prototype, 'hide_filters_groupby.ControlPanel',{ + setup() { + this.actionService = useService("action"); + this.dialog = useService("dialog"); + this.pagerProps = this.env.config.pagerProps + ? useState(this.env.config.pagerProps) + : undefined; + this.breadcrumbs = useState(this.env.config.breadcrumbs); + this.root = useRef("root"); + this.state = useState({ + showSearchBar: false, + showViewSwitcher: false, + }); + this.onScrollThrottledBound = this.onScrollThrottled.bind(this); + useExternalListener(window, "click", this.onWindowClick); + useEffect(() => { + if ( + !this.env.isSmall || + ("adaptToScroll" in this.display && !this.display.adaptToScroll) + ) { + return; + } + const scrollingEl = this.getScrollingElement(); + scrollingEl.addEventListener("scroll", this.onScrollThrottledBound); + this.root.el.style.top = "0px"; + return () => { + scrollingEl.removeEventListener("scroll", this.onScrollThrottledBound); + }; + }); + onMounted(() => { + if ( + !this.env.isSmall || + ("adaptToScroll" in this.display && !this.display.adaptToScroll) + ) { + return; + } + this.oldScrollTop = 0; + this.lastScrollTop = 0; + this.initialScrollTop = this.getScrollingElement().scrollTop; + }); + if (session.is_hide_filters_groupby_enabled == 'True'){ + if (session.hide_filters_groupby == 'global'){ + onMounted(this.hide_globally) + } else if (session.hide_filters_groupby == 'custom'){ + onMounted(this.hide_on_custom) + } + } + }, + /** + * Customized method to hide filter and groupby options globally. + * This method is called when the 'session.hide_filters_groupby_is_enabled' is 'True' and + * 'session.hide_filters_groupby' is set to 'global'. + */ + //hides filter and groupby options globally + hide_globally(){ + this.root.el.querySelector('.o_search_options').style.display = 'none'; + }, + //hides filter and groupby options on custom choice + /** + * Customized method to hide filter and groupby options based on custom settings. + * This method is called when the 'session.hide_filters_groupby_is_enabled' is 'True' and + * 'session.hide_filters_groupby' is set to 'custom'. + */ + hide_on_custom(){ + if (this.env.searchModel){ + var model_id = this.env.services.orm.search("ir.model", [["model", "=", this.env.searchModel.resModel]], { + limit: 1, + }).then((value) =>{ + if (eval(session.ir_model_ids).includes(value[0])){ + this.root.el.querySelector('.o_search_options').style.display = 'none'; + } + }); + } + } +}); diff --git a/hide_filters_groupby/static/src/js/search_model.js b/hide_filters_groupby/static/src/js/search_model.js new file mode 100644 index 000000000..0f0f1f8cf --- /dev/null +++ b/hide_filters_groupby/static/src/js/search_model.js @@ -0,0 +1,180 @@ +/** @odoo-module **/ +/** + * This module contains JavaScript code that is used to customize the behavior of the Search Model + * in the Odoo web interface. It includes patches to remove default filter and groupby options + * based on the global or custom settings. + */ + import session from 'web.session'; +import { SearchModel } from "@web/search/search_model"; +import { SearchArchParser } from "@web/search/search_arch_parser"; +import { toRaw } from "@odoo/owl"; +import { patch } from "@web/core/utils/patch"; +//This patch is used to remove default filter and groupby option on the basis of globally or custom +patch(SearchModel.prototype, 'hide_filters_groupby.SearchModel',{ + async load(config) { + const { resModel } = config; + if (!resModel) { + throw Error(`SearchPanel config should have a "resModel" key`); + } + this.resModel = resModel; + const modelId = ( + await this.env.services.orm.search("ir.model", [["model", "=", resModel]], { + limit: 1, + }) + )[0]; + if (session.is_hide_filters_groupby_enabled == 'True'){ + //remove default filter and groupby options globally + if (session.hide_filters_groupby == 'global'){ + for (var key = 0; key < Object.keys(config['context']).length; key++){ + if (Object.keys(config['context'])[key].includes('search_default')){ + delete config['context'][Object.keys(config['context'])[key]] + } + } + } else if (session.hide_filters_groupby == 'custom'){ + //remove default filter and groupby options on custom choice + if (eval(session.ir_model_ids).includes(modelId)){ + for (var key = 0; key < Object.keys(config['context']).length; key++){ + if (Object.keys(config['context'])[key].includes('search_default')){ + delete config['context'][Object.keys(config['context'])[key]] + } + } + } + } + } + // used to avoid useless re computations + this._reset(); + const { comparison, context, domain, groupBy, hideCustomGroupBy, orderBy } = config; + this.globalComparison = comparison; + this.globalContext = toRaw(Object.assign({}, context)); + this.globalDomain = domain || []; + this.globalGroupBy = groupBy || []; + this.globalOrderBy = orderBy || []; + this.hideCustomGroupBy = hideCustomGroupBy; + this.searchMenuTypes = new Set(config.searchMenuTypes || ["filter", "groupBy", "favorite"]); + let { irFilters, loadIrFilters, searchViewArch, searchViewFields, searchViewId } = config; + const loadSearchView = + searchViewId !== undefined && + (!searchViewArch || !searchViewFields || (!irFilters && loadIrFilters)); + const searchViewDescription = {}; + if (loadSearchView) { + const result = await this.viewService.loadViews( + { + context: this.globalContext, + resModel, + views: [[searchViewId, "search"]], + }, + { + actionId: this.env.config.actionId, + loadIrFilters: loadIrFilters || false, + } + ); + Object.assign(searchViewDescription, result.views.search); + searchViewFields = searchViewFields || result.fields; + } + if (searchViewArch) { + searchViewDescription.arch = searchViewArch; + } + if (irFilters) { + searchViewDescription.irFilters = irFilters; + } + if (searchViewId !== undefined) { + searchViewDescription.viewId = searchViewId; + } + this.searchViewArch = searchViewDescription.arch || ""; + this.searchViewFields = searchViewFields || {}; + if (searchViewDescription.irFilters) { + this.irFilters = searchViewDescription.irFilters; + } + if (searchViewDescription.viewId !== undefined) { + this.searchViewId = searchViewDescription.viewId; + } + if (config.state) { + this._importState(config.state); + this.__legacyParseSearchPanelArchAnyway(searchViewDescription, searchViewFields); + this.domainParts = {}; + this.display = this._getDisplay(config.display); + if (!this.searchPanelInfo.loaded) { + return this._reloadSections(); + } + return; + } + this.blockNotification = true; + this.searchItems = {}; + this.query = []; + this.nextId = 1; + this.nextGroupId = 1; + this.nextGroupNumber = 1; + // ... to rework (API for external domain, groupBy, facet) + this.domainParts = {}; // put in state? + const searchDefaults = {}; + const searchPanelDefaults = {}; + for (const key in this.globalContext) { + const defaultValue = this.globalContext[key]; + const searchDefaultMatch = /^search_default_(.*)$/.exec(key); + if (searchDefaultMatch) { + if (defaultValue) { + searchDefaults[searchDefaultMatch[1]] = defaultValue; + } + delete this.globalContext[key]; + continue; + } + const searchPanelDefaultMatch = /^searchpanel_default_(.*)$/.exec(key); + if (searchPanelDefaultMatch) { + searchPanelDefaults[searchPanelDefaultMatch[1]] = defaultValue; + delete this.globalContext[key]; + } + } + const parser = new SearchArchParser( + searchViewDescription, + searchViewFields, + searchDefaults, + searchPanelDefaults + ); + const { labels, preSearchItems, searchPanelInfo, sections } = parser.parse(); + this.searchPanelInfo = { ...searchPanelInfo, loaded: false, shouldReload: false }; + await Promise.all(labels.map((cb) => cb(this.orm))); + // prepare search items (populate this.searchItems) + for (const preGroup of preSearchItems || []) { + this._createGroupOfSearchItems(preGroup); + } + this.nextGroupNumber = + 1 + Math.max(...Object.values(this.searchItems).map((i) => i.groupNumber || 0), 0); + const dateFilters = Object.values(this.searchItems).filter( + (searchElement) => searchElement.type === "dateFilter" + ); + if (dateFilters.length) { + this._createGroupOfComparisons(dateFilters); + } + const { dynamicFilters } = config; + if (dynamicFilters) { + this._createGroupOfDynamicFilters(dynamicFilters); + } + const defaultFavoriteId = this._createGroupOfFavorites(this.irFilters || []); + const activateFavorite = "activateFavorite" in config ? config.activateFavorite : true; + // activate default search items (populate this.query) + this._activateDefaultSearchItems(activateFavorite ? defaultFavoriteId : null); + // prepare search panel sections + /** @type Map */ + this.sections = new Map(sections || []); + this.display = this._getDisplay(config.display); + if (this.display.searchPanel) { + /** @type DomainListRepr */ + this.searchDomain = this._getDomain({ withSearchPanel: false }); + this.sectionsPromise = this._fetchSections(this.categories, this.filters).then(() => { + for (const { fieldName, values } of this.filters) { + const filterDefaults = searchPanelDefaults[fieldName] || []; + for (const valueId of filterDefaults) { + const value = values.get(valueId); + if (value) { + value.checked = true; + } + } + } + }); + if (Object.keys(searchPanelDefaults).length || this._shouldWaitForData(false)) { + await this.sectionsPromise; + } + } + this.blockNotification = false; + } +}); diff --git a/hide_filters_groupby/views/res_config_settings_views.xml b/hide_filters_groupby/views/res_config_settings_views.xml new file mode 100644 index 000000000..c29dd1e90 --- /dev/null +++ b/hide_filters_groupby/views/res_config_settings_views.xml @@ -0,0 +1,47 @@ + + + + + + res.config.settings.view.form.inherit.hide.filters.groupby + + res.config.settings + + + +
+

Hide Filters and Group By

+
+
+
+ +
+
+
+
+
+
+
+
+