diff --git a/model_access_rights/README.rst b/model_access_rights/README.rst new file mode 100644 index 000000000..8b3eb618d --- /dev/null +++ b/model_access_rights/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Hide Create|Delete|Archive|Export Options - Model Wise +=================== +* Can hide options like create,delete,export,and archive/un archive in a model to specific user groups. + +Configuration +============= +No additional configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +======= +GNU Affero General Public License v3.0 (AGPL v3) +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +======= +* Developer: (V15) Rahul C K, Contact: odoo@cybrosys.com + +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 https://www.cybrosys.com. + +Further information +=================== +HTML Description: ``__ diff --git a/model_access_rights/__init__.py b/model_access_rights/__init__.py new file mode 100644 index 000000000..8a28dd1a2 --- /dev/null +++ b/model_access_rights/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Rahul CK() +# +# You can modify it under the terms of the GNU AFFERO GENERAL +# PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC +# LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/model_access_rights/__manifest__.py b/model_access_rights/__manifest__.py new file mode 100644 index 000000000..17ee658b7 --- /dev/null +++ b/model_access_rights/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Rahul CK() +# +# You can modify it under the terms of the GNU AFFERO GENERAL +# PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC +# LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Hide Create|Delete|Archive|Export Options - Model Wise', + 'version': '15.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Hide module features for user groups.""", + 'description': """ + Can restrict create, update, delete, archive/unarchive, export in + different models to user groups. + """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base_setup', 'mail'], + 'data': [ + 'security/model_access_rights_groups.xml', + 'security/ir.model.access.csv', + 'views/access_right_views.xml' + ], + 'assets': { + 'web.assets_backend': [ + 'model_access_rights/static/src/js/form_controller.js', + 'model_access_rights/static/src/js/list_controller.js', + 'model_access_rights/static/src/js/kanban_controller.js' + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/model_access_rights/doc/RELEASE_NOTES.md b/model_access_rights/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..964436c32 --- /dev/null +++ b/model_access_rights/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.11.2023 +#### Version 15.0.1.0.0 +##### ADD +- Initial Commit for Hide Create|Delete|Archive|Export Options - Model Wise diff --git a/model_access_rights/models/__init__.py b/model_access_rights/models/__init__.py new file mode 100644 index 000000000..bc6838fb9 --- /dev/null +++ b/model_access_rights/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Rahul CK() +# +# You can modify it under the terms of the GNU AFFERO GENERAL +# PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC +# LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import access_right diff --git a/model_access_rights/models/access_right.py b/model_access_rights/models/access_right.py new file mode 100644 index 000000000..aff5ed0ff --- /dev/null +++ b/model_access_rights/models/access_right.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Rahul CK() +# +# You can modify it under the terms of the GNU AFFERO GENERAL +# PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC +# LICENSE (AGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import api, fields, models + + +class AccessRight(models.Model): + """This class is used to detect, which all options want to hide from the + specified group and model""" + _name = 'access.right' + _inherit = 'mail.thread' + _description = 'Manage Modules Access Control' + _rec_name = 'model_id' + + model_id = fields.Many2one('ir.model', ondelete='cascade', + required=True, string="Model", + help="Select the model") + groups_id = fields.Many2one('res.groups', required=True, + string="Groups", help="Select the group") + is_delete = fields.Boolean(string="Delete", help="Hide the delete option") + is_export = fields.Boolean(string="Export", + help="Hide the 'Export All'" + " option from list view") + is_create_or_update = fields.Boolean(string="Create/Update", + help="Hide the create option " + "from list as well as form view") + is_archive = fields.Boolean(string="Archive/UnArchive", + help="Hide the archive option") + + @api.model + def hide_buttons(self, args): + """This function contains a query that detects which all options want + to hide, in which model,and to which user groups""" + access_right_rec = self.sudo().search_read([], + ['model_id', 'is_delete', + 'is_export', + 'is_create_or_update', + 'is_archive', + 'groups_id']) + for rec in access_right_rec: + model_id = self.env['ir.model'].sudo(). \ + browse(rec['model_id'][0]).model + if str(model_id) == args[1]: + groups = self.env['res.users'].browse(args[0]).groups_id.ids + if rec['groups_id'][0] in groups: + data = { + 'is_delete': rec['is_delete'], + 'is_export': rec['is_export'], + 'is_create_or_update': rec['is_create_or_update'], + 'is_archive': rec['is_archive'] + } + return data diff --git a/model_access_rights/security/ir.model.access.csv b/model_access_rights/security/ir.model.access.csv new file mode 100644 index 000000000..d48fe8d3b --- /dev/null +++ b/model_access_rights/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_access_right_user,access.access.right.user,model_access_right,model_access_rights.group_model_access_control,1,1,1,1 diff --git a/model_access_rights/security/model_access_rights_groups.xml b/model_access_rights/security/model_access_rights_groups.xml new file mode 100644 index 000000000..30f52281e --- /dev/null +++ b/model_access_rights/security/model_access_rights_groups.xml @@ -0,0 +1,9 @@ + + + + + Configure Model Access + + + + diff --git a/model_access_rights/static/description/assets/icons/check.png b/model_access_rights/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/model_access_rights/static/description/assets/icons/check.png differ diff --git a/model_access_rights/static/description/assets/icons/chevron.png b/model_access_rights/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/chevron.png differ diff --git a/model_access_rights/static/description/assets/icons/cogs.png b/model_access_rights/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/cogs.png differ diff --git a/model_access_rights/static/description/assets/icons/consultation.png b/model_access_rights/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/model_access_rights/static/description/assets/icons/consultation.png differ diff --git a/model_access_rights/static/description/assets/icons/ecom-black.png b/model_access_rights/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/ecom-black.png differ diff --git a/model_access_rights/static/description/assets/icons/education-black.png b/model_access_rights/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/model_access_rights/static/description/assets/icons/education-black.png differ diff --git a/model_access_rights/static/description/assets/icons/hotel-black.png b/model_access_rights/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/model_access_rights/static/description/assets/icons/hotel-black.png differ diff --git a/model_access_rights/static/description/assets/icons/license.png b/model_access_rights/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/model_access_rights/static/description/assets/icons/license.png differ diff --git a/model_access_rights/static/description/assets/icons/lifebuoy.png b/model_access_rights/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/model_access_rights/static/description/assets/icons/lifebuoy.png differ diff --git a/model_access_rights/static/description/assets/icons/manufacturing-black.png b/model_access_rights/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/model_access_rights/static/description/assets/icons/manufacturing-black.png differ diff --git a/model_access_rights/static/description/assets/icons/pos-black.png b/model_access_rights/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/pos-black.png differ diff --git a/model_access_rights/static/description/assets/icons/puzzle.png b/model_access_rights/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/puzzle.png differ diff --git a/model_access_rights/static/description/assets/icons/restaurant-black.png b/model_access_rights/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/restaurant-black.png differ diff --git a/model_access_rights/static/description/assets/icons/service-black.png b/model_access_rights/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/model_access_rights/static/description/assets/icons/service-black.png differ diff --git a/model_access_rights/static/description/assets/icons/trading-black.png b/model_access_rights/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/model_access_rights/static/description/assets/icons/trading-black.png differ diff --git a/model_access_rights/static/description/assets/icons/training.png b/model_access_rights/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/model_access_rights/static/description/assets/icons/training.png differ diff --git a/model_access_rights/static/description/assets/icons/update.png b/model_access_rights/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/model_access_rights/static/description/assets/icons/update.png differ diff --git a/model_access_rights/static/description/assets/icons/user.png b/model_access_rights/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/model_access_rights/static/description/assets/icons/user.png differ diff --git a/model_access_rights/static/description/assets/icons/wrench.png b/model_access_rights/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/model_access_rights/static/description/assets/icons/wrench.png differ diff --git a/model_access_rights/static/description/assets/misc/categories.png b/model_access_rights/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/categories.png differ diff --git a/model_access_rights/static/description/assets/misc/check-box.png b/model_access_rights/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/check-box.png differ diff --git a/model_access_rights/static/description/assets/misc/compass.png b/model_access_rights/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/model_access_rights/static/description/assets/misc/compass.png differ diff --git a/model_access_rights/static/description/assets/misc/corporate.png b/model_access_rights/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/model_access_rights/static/description/assets/misc/corporate.png differ diff --git a/model_access_rights/static/description/assets/misc/customer-support.png b/model_access_rights/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/model_access_rights/static/description/assets/misc/customer-support.png differ diff --git a/model_access_rights/static/description/assets/misc/cybrosys-logo.png b/model_access_rights/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/model_access_rights/static/description/assets/misc/cybrosys-logo.png differ diff --git a/model_access_rights/static/description/assets/misc/features.png b/model_access_rights/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/features.png differ diff --git a/model_access_rights/static/description/assets/misc/logo.png b/model_access_rights/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/model_access_rights/static/description/assets/misc/logo.png differ diff --git a/model_access_rights/static/description/assets/misc/pictures.png b/model_access_rights/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/pictures.png differ diff --git a/model_access_rights/static/description/assets/misc/pie-chart.png b/model_access_rights/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/pie-chart.png differ diff --git a/model_access_rights/static/description/assets/misc/right-arrow.png b/model_access_rights/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/right-arrow.png differ diff --git a/model_access_rights/static/description/assets/misc/star.png b/model_access_rights/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/model_access_rights/static/description/assets/misc/star.png differ diff --git a/model_access_rights/static/description/assets/misc/support.png b/model_access_rights/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/support.png differ diff --git a/model_access_rights/static/description/assets/misc/whatsapp.png b/model_access_rights/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/model_access_rights/static/description/assets/misc/whatsapp.png differ diff --git a/model_access_rights/static/description/assets/modules/2.png b/model_access_rights/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/model_access_rights/static/description/assets/modules/2.png differ diff --git a/model_access_rights/static/description/assets/modules/m1.png b/model_access_rights/static/description/assets/modules/m1.png new file mode 100644 index 000000000..6bc155887 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m1.png differ diff --git a/model_access_rights/static/description/assets/modules/m3.png b/model_access_rights/static/description/assets/modules/m3.png new file mode 100644 index 000000000..9eea75430 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m3.png differ diff --git a/model_access_rights/static/description/assets/modules/m4.png b/model_access_rights/static/description/assets/modules/m4.png new file mode 100644 index 000000000..707e2b7ed Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m4.png differ diff --git a/model_access_rights/static/description/assets/modules/m5.jpg b/model_access_rights/static/description/assets/modules/m5.jpg new file mode 100644 index 000000000..1c389b5d7 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m5.jpg differ diff --git a/model_access_rights/static/description/assets/modules/m6.jpg b/model_access_rights/static/description/assets/modules/m6.jpg new file mode 100644 index 000000000..80df50081 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m6.jpg differ diff --git a/model_access_rights/static/description/assets/screenshots/7.png b/model_access_rights/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..f4fc41bf5 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/7.png differ diff --git a/model_access_rights/static/description/assets/screenshots/hero.gif b/model_access_rights/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..81f559ce6 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/hero.gif differ diff --git a/model_access_rights/static/description/assets/screenshots/image_1.png b/model_access_rights/static/description/assets/screenshots/image_1.png new file mode 100644 index 000000000..bbac71c83 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/image_1.png differ diff --git a/model_access_rights/static/description/assets/screenshots/image_5.png b/model_access_rights/static/description/assets/screenshots/image_5.png new file mode 100644 index 000000000..8c9aab0bf Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/image_5.png differ diff --git a/model_access_rights/static/description/assets/screenshots/image_6.png b/model_access_rights/static/description/assets/screenshots/image_6.png new file mode 100644 index 000000000..82434fd6e Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/image_6.png differ diff --git a/model_access_rights/static/description/assets/screenshots/s2.png b/model_access_rights/static/description/assets/screenshots/s2.png new file mode 100644 index 000000000..495e4b193 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/s2.png differ diff --git a/model_access_rights/static/description/assets/screenshots/s3.png b/model_access_rights/static/description/assets/screenshots/s3.png new file mode 100644 index 000000000..493ae37fe Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/s3.png differ diff --git a/model_access_rights/static/description/assets/screenshots/s4.png b/model_access_rights/static/description/assets/screenshots/s4.png new file mode 100644 index 000000000..d40010c50 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/s4.png differ diff --git a/model_access_rights/static/description/banner.jpg b/model_access_rights/static/description/banner.jpg new file mode 100644 index 000000000..746b49908 Binary files /dev/null and b/model_access_rights/static/description/banner.jpg differ diff --git a/model_access_rights/static/description/icon.png b/model_access_rights/static/description/icon.png new file mode 100644 index 000000000..1b9e0fa7b Binary files /dev/null and b/model_access_rights/static/description/icon.png differ diff --git a/model_access_rights/static/description/index.html b/model_access_rights/static/description/index.html new file mode 100644 index 000000000..6fbd75a82 --- /dev/null +++ b/model_access_rights/static/description/index.html @@ -0,0 +1,675 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Hide Create|Delete|Archive|Export Options - Model Wise

+

+ Hide Model View Actions for User Groups

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ By using this module we can hide the options like + create,delete,export,and archive/un archive in the model + which we want. Here we are also able to select the user groups except + Administrator which we want to apply the + above hiding functionality +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Easily hide the options like Create,Delete,Export and Archive/UnArchive +
+
+ + Can hide the options for specific model +
+
+ + Can hide the options for specific user group +
+
+ + No additional configuration needed +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Go to Settings > Users and there you can see the Configure + Model Access, by enabling that + option and refresh the page.

+ +
+ +
+

+ You can see a new menu named 'Restrict Access Rights'

+ +
+ +
+

+ Select the group of any user, model in which it is applied. + Here 'User:Own Documents Only' in 'Sales' is selected.
+ Imp: Features will be hidden for all the users with this group. +

+ +
+
+

+ Open the menu 'Restrict Access Rights' to configure the + features.
+ Choose the group and model in which the feature should be + applied. Select which all features should be hidden. +

+ +
+ +
+

+ Create, Delete, Edit features are hidden for the user in tree + view.

+ +
+
+

+ Create, Delete, Edit features are hidden for the user in form + view.

+ +
+
+

+ Create, Delete, Edit features are hidden for the user in kanban + view.

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

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/model_access_rights/static/src/js/form_controller.js b/model_access_rights/static/src/js/form_controller.js new file mode 100644 index 000000000..ccf6aea4b --- /dev/null +++ b/model_access_rights/static/src/js/form_controller.js @@ -0,0 +1,33 @@ +/** @odoo-module */ +/** + * This file will used to hide the selected options from the form view + */ +import FormController from 'web.FormController'; +import { patch } from "@web/core/utils/patch"; +import rpc from 'web.rpc'; +patch(FormController.prototype, 'model_access_rights/static/src/js/form_controller.js.FormController', { +/** +* This function will used to hide the selected options from the form view +*/ + async willStart() { + var self = this; + var user_id = self.initialState.context.uid; + var model = self.modelName; + await rpc.query({model: 'access.right', method: 'hide_buttons', + args: [[user_id, model]], + }).then(function(data) { + if(data){ + if(data['is_create_or_update']){ + self.activeActions.create = false; + self.activeActions.edit = false; + } + if(data['is_delete']){ + self.activeActions.delete = false; + } + if(data['is_archive']){ + self.archiveEnabled = false; + } + } + }); + }, +}); diff --git a/model_access_rights/static/src/js/kanban_controller.js b/model_access_rights/static/src/js/kanban_controller.js new file mode 100644 index 000000000..923b22165 --- /dev/null +++ b/model_access_rights/static/src/js/kanban_controller.js @@ -0,0 +1,36 @@ +/** @odoo-module */ +/** + * This file will used to hide the selected options from the kanban view + */ +import KanbanController from 'web.KanbanController'; +import { patch } from "@web/core/utils/patch"; +import rpc from 'web.rpc'; +patch(KanbanController.prototype, 'model_access_rights/static/src/js/kanban_controller.js.KanbanController', { +/** +* This function will used to hide the selected options from the kanban view +*/ + async willStart() { + var self = this; + var user_id = self.initialState.context.uid; + var model = self.modelName; + await rpc.query({model: 'access.right', method: 'hide_buttons', + args: [[user_id, model]], + }).then(function(data) { + if(data){ + if(data['is_create_or_update']){ + self.activeActions.create = false; + self.activeActions.edit = false; + } + if(data['is_delete']){ + self.activeActions.delete = false; + } + if(data['is_archive']){ + self.archiveEnabled = false; + } + if(data['is_export']){ + self.isExportEnable = false; + } + } + }); + }, +}); diff --git a/model_access_rights/static/src/js/list_controller.js b/model_access_rights/static/src/js/list_controller.js new file mode 100644 index 000000000..9576acb5d --- /dev/null +++ b/model_access_rights/static/src/js/list_controller.js @@ -0,0 +1,36 @@ +/** @odoo-module */ +/** + * This file will used to hide the selected options from the list view + */ +import ListController from 'web.ListController'; +import { patch } from "@web/core/utils/patch"; +import rpc from 'web.rpc'; +patch(ListController.prototype, 'model_access_rights/static/src/js/list_controller.js.ListController', { +/** +* This function will used to hide the selected options from the list view +*/ + async willStart() { + var self = this; + var user_id = self.initialState.context.uid; + var model = self.modelName; + await rpc.query({model: 'access.right', method: 'hide_buttons', + args: [[user_id, model]], + }).then(function(data) { + if(data){ + if(data['is_create_or_update']){ + self.activeActions.create = false; + self.activeActions.edit = false; + } + if(data['is_delete']){ + self.activeActions.delete = false; + } + if(data['is_archive']){ + self.archiveEnabled = false; + } + if(data['is_export']){ + self.isExportEnable = false; + } + } + }); + }, +}); diff --git a/model_access_rights/views/access_right_views.xml b/model_access_rights/views/access_right_views.xml new file mode 100644 index 000000000..844ad1167 --- /dev/null +++ b/model_access_rights/views/access_right_views.xml @@ -0,0 +1,58 @@ + + + + + access.right.view.tree + access.right + + + + + + + + + + + + + + access.right.view.form + access.right + +
+ + + + + + + + + + + + + + +
+ + +
+
+
+
+ + + Restrict Access Rights + access.right + tree,form + + + +