diff --git a/model_access_rights/README.rst b/model_access_rights/README.rst new file mode 100644 index 000000000..77834bf49 --- /dev/null +++ b/model_access_rights/README.rst @@ -0,0 +1,45 @@ +.. 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) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +======= +* Developer: (V14) 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..313bae3d3 --- /dev/null +++ b/model_access_rights/__manifest__.py @@ -0,0 +1,45 @@ +# -*- 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': '14.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', + 'views/assets.xml' + ], + '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..74f62cf78 --- /dev/null +++ b/model_access_rights/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 16.11.2023 +#### Version 14.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..5044d07d0 --- /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', string="Groups", + required=True, 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..8a65ce2bd --- /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/m1.png b/model_access_rights/static/description/assets/modules/m1.png new file mode 100644 index 000000000..8960b7cb4 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/m2.png b/model_access_rights/static/description/assets/modules/m2.png new file mode 100644 index 000000000..be440eb23 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m2.png differ diff --git a/model_access_rights/static/description/assets/modules/m3.jpg b/model_access_rights/static/description/assets/modules/m3.jpg new file mode 100644 index 000000000..34a960d47 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m3.jpg 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..395b22fff 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.png b/model_access_rights/static/description/assets/modules/m5.png new file mode 100644 index 000000000..5f1708a43 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m5.png differ diff --git a/model_access_rights/static/description/assets/modules/m6.png b/model_access_rights/static/description/assets/modules/m6.png new file mode 100644 index 000000000..999ba4333 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/m6.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..f3b08cabb 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/S4.png b/model_access_rights/static/description/assets/screenshots/S4.png new file mode 100644 index 000000000..1b40f4618 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/S4.png differ diff --git a/model_access_rights/static/description/assets/screenshots/S5.png b/model_access_rights/static/description/assets/screenshots/S5.png new file mode 100644 index 000000000..38c379a74 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/S5.png differ diff --git a/model_access_rights/static/description/assets/screenshots/S6.png b/model_access_rights/static/description/assets/screenshots/S6.png new file mode 100644 index 000000000..47acc5aa4 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/S6.png differ diff --git a/model_access_rights/static/description/assets/screenshots/S7.png b/model_access_rights/static/description/assets/screenshots/S7.png new file mode 100644 index 000000000..96a47e66c Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/S7.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..8c247c3dc 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..7a2c06805 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_3.png b/model_access_rights/static/description/assets/screenshots/image_3.png new file mode 100644 index 000000000..321c4a60a Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/image_3.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..17031f4d2 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..3a2e37f80 --- /dev/null +++ b/model_access_rights/static/description/index.html @@ -0,0 +1,668 @@ +
+ +
+ +
+
+ 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:All Documents' 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..b03dd1c01 --- /dev/null +++ b/model_access_rights/static/src/js/form_controller.js @@ -0,0 +1,38 @@ +odoo.define('model_access_rights/static/src/js/form_controller.js', function (require) { +'use strict'; + + var FormController = require('web.FormController'); + const { patch } = require('web.utils'); + var rpc = require('web.rpc'); + + const components = { + FormController: require('web.FormController'), + }; + + patch(components.FormController, '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..afcbcc52b --- /dev/null +++ b/model_access_rights/static/src/js/kanban_controller.js @@ -0,0 +1,38 @@ +odoo.define('model_access_rights/static/src/js/kanban_controller.js', function (require) { +'use strict'; + + var KanbanController = require('web.KanbanController'); + const { patch } = require('web.utils'); + var rpc = require('web.rpc'); + + const components = { + KanbanController: require('web.KanbanController'), + }; + + patch(components.KanbanController, '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; + } + } + }); + }, + }); +}); 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..b3a2a0c2c --- /dev/null +++ b/model_access_rights/static/src/js/list_controller.js @@ -0,0 +1,41 @@ +odoo.define('model_access_rights/static/src/js/list_controller.js', function (require) { +'use strict'; + + var ListController = require('web.ListController'); + const { patch } = require('web.utils'); + var rpc = require('web.rpc'); + + const components = { + ListController: require('web.ListController'), + }; + + patch(components.ListController, '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..c787da4a0 --- /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 + + + +
diff --git a/model_access_rights/views/assets.xml b/model_access_rights/views/assets.xml new file mode 100644 index 000000000..45fa973e6 --- /dev/null +++ b/model_access_rights/views/assets.xml @@ -0,0 +1,15 @@ + + + +