diff --git a/model_access_rights/README.rst b/model_access_rights/README.rst new file mode 100644 index 000000000..48f5ef657 --- /dev/null +++ b/model_access_rights/README.rst @@ -0,0 +1,42 @@ +Model Access Rights +=================== +* Model Access Rights for Odoo 16 community editions + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +(v16) Anjana P V @ Cybrosys + + +Contacts +-------- +* Mail Contact : odoo@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 +========== +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..7b2c59c1c --- /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: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL 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..ea32f9820 --- /dev/null +++ b/model_access_rights/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Model Access Rights', + 'version': '16.0.1.0.0', + 'category': 'Others', + 'summary': """ Can hide options from user """, + 'description': """Can hide options according to specific model + and access group """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': [ + 'base_setup', + 'mail', + ], + 'data': [ + 'security/security.xml', + 'security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'views/model_access_rights_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'model_access_rights/static/src/js/form_controller.js', + 'model_access_rights/static/src/js/list_controller.js', + ] + }, + + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/model_access_rights/data/ir_sequence_data.xml b/model_access_rights/data/ir_sequence_data.xml new file mode 100644 index 000000000..0cb302588 --- /dev/null +++ b/model_access_rights/data/ir_sequence_data.xml @@ -0,0 +1,10 @@ + + + + Model Access Right + access.right + MAR + 5 + + + \ No newline at end of file diff --git a/model_access_rights/doc/RELEASE_NOTES.md b/model_access_rights/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..82b87eeac --- /dev/null +++ b/model_access_rights/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 20.02.2023 +#### Version 16.0.1.0.0 +##### ADD + +- Initial Commit for model_access_rights + + diff --git a/model_access_rights/models/__init__.py b/model_access_rights/models/__init__.py new file mode 100644 index 000000000..58bafa3bb --- /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: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import model_access_rights diff --git a/model_access_rights/models/model_access_rights.py b/model_access_rights/models/model_access_rights.py new file mode 100644 index 000000000..e8d1b99a1 --- /dev/null +++ b/model_access_rights/models/model_access_rights.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +"""This model is used to detect, which all options want to hide from the + specified group and model""" +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields, api, _ + + +class ModelAccessRights(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' + + model_id = fields.Many2one('ir.model', ondelete='cascade', required=True, + help="select the model") + groups_id = fields.Many2one('res.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") + name = fields.Char(string='Order Reference', readonly=True, + default=lambda self: _('New')) + + @api.model + def create(self, vals): + """This function is used to create the sequence number for this model""" + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code( + 'access.right') or _('New') + res = super(ModelAccessRights, self).create(vals) + return res + + @api.model + def hide_buttons(self): + """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 dic in access_right_rec: + model = self.env['ir.model'].sudo().browse(dic['model_id'][0]).model + group_name = self.env['ir.model.data'].sudo().search([ + ('model', '=', 'res.groups'), + ('res_id', '=', dic['groups_id'][0]) + ]).name + + module_name = self.env['ir.model.data'].sudo().search([ + ('model', '=', 'res.groups'), + ('res_id', '=', dic['groups_id'][0]) + ]).module + dic.update({ + 'model': model, + 'group_name': group_name, + 'module': module_name + }) + return access_right_rec 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..a9c391316 --- /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,access_access_right,model_access_right,model_access_rights.group_model_access_control,1,1,1,1 diff --git a/model_access_rights/security/security.xml b/model_access_rights/security/security.xml new file mode 100644 index 000000000..b23564939 --- /dev/null +++ b/model_access_rights/security/security.xml @@ -0,0 +1,8 @@ + + + + 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/1.png b/model_access_rights/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/model_access_rights/static/description/assets/modules/1.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/3.png b/model_access_rights/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/model_access_rights/static/description/assets/modules/3.png differ diff --git a/model_access_rights/static/description/assets/modules/4.png b/model_access_rights/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/model_access_rights/static/description/assets/modules/4.png differ diff --git a/model_access_rights/static/description/assets/modules/5.gif b/model_access_rights/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/5.gif differ diff --git a/model_access_rights/static/description/assets/modules/6.png b/model_access_rights/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/model_access_rights/static/description/assets/modules/6.png differ diff --git a/model_access_rights/static/description/assets/screenshots/03_purchase_user_grp.png b/model_access_rights/static/description/assets/screenshots/03_purchase_user_grp.png new file mode 100644 index 000000000..2b200cba3 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/03_purchase_user_grp.png differ diff --git a/model_access_rights/static/description/assets/screenshots/10_marcdemo_project_grp.png b/model_access_rights/static/description/assets/screenshots/10_marcdemo_project_grp.png new file mode 100644 index 000000000..4ef3c2e61 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/10_marcdemo_project_grp.png differ diff --git a/model_access_rights/static/description/assets/screenshots/11_project_original.png b/model_access_rights/static/description/assets/screenshots/11_project_original.png new file mode 100644 index 000000000..00ef7b30e Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/11_project_original.png differ diff --git a/model_access_rights/static/description/assets/screenshots/12_export_archive_hide.png b/model_access_rights/static/description/assets/screenshots/12_export_archive_hide.png new file mode 100644 index 000000000..4316a5ec5 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/12_export_archive_hide.png differ diff --git a/model_access_rights/static/description/assets/screenshots/13_hidden_export_archive.png b/model_access_rights/static/description/assets/screenshots/13_hidden_export_archive.png new file mode 100644 index 000000000..e95d997e7 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/13_hidden_export_archive.png differ diff --git a/model_access_rights/static/description/assets/screenshots/1_field_menu.png b/model_access_rights/static/description/assets/screenshots/1_field_menu.png new file mode 100644 index 000000000..4f6c20f52 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/1_field_menu.png differ diff --git a/model_access_rights/static/description/assets/screenshots/2_model_grp.png b/model_access_rights/static/description/assets/screenshots/2_model_grp.png new file mode 100644 index 000000000..c1e979977 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/2_model_grp.png differ diff --git a/model_access_rights/static/description/assets/screenshots/2_user_grp.png b/model_access_rights/static/description/assets/screenshots/2_user_grp.png new file mode 100644 index 000000000..4e71fc6c4 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/2_user_grp.png differ diff --git a/model_access_rights/static/description/assets/screenshots/3_user_grp.png b/model_access_rights/static/description/assets/screenshots/3_user_grp.png new file mode 100644 index 000000000..4e71fc6c4 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/3_user_grp.png differ diff --git a/model_access_rights/static/description/assets/screenshots/4_po_create_hide_tree.png b/model_access_rights/static/description/assets/screenshots/4_po_create_hide_tree.png new file mode 100644 index 000000000..e5b0c3ee4 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/4_po_create_hide_tree.png differ diff --git a/model_access_rights/static/description/assets/screenshots/5_Export_dlt_hide.png b/model_access_rights/static/description/assets/screenshots/5_Export_dlt_hide.png new file mode 100644 index 000000000..383587406 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/5_Export_dlt_hide.png differ diff --git a/model_access_rights/static/description/assets/screenshots/6_export_dlt_hide_marc.png b/model_access_rights/static/description/assets/screenshots/6_export_dlt_hide_marc.png new file mode 100644 index 000000000..9c9c26544 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/6_export_dlt_hide_marc.png differ diff --git a/model_access_rights/static/description/assets/screenshots/7_delete_hide_in_form.png b/model_access_rights/static/description/assets/screenshots/7_delete_hide_in_form.png new file mode 100644 index 000000000..fa8d52b75 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/7_delete_hide_in_form.png differ diff --git a/model_access_rights/static/description/assets/screenshots/8_archieve_edit_hide.png b/model_access_rights/static/description/assets/screenshots/8_archieve_edit_hide.png new file mode 100644 index 000000000..e5bd20dd3 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/8_archieve_edit_hide.png differ diff --git a/model_access_rights/static/description/assets/screenshots/9_edit_archive_hide.png b/model_access_rights/static/description/assets/screenshots/9_edit_archive_hide.png new file mode 100644 index 000000000..6510ffd58 Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/9_edit_archive_hide.png differ diff --git a/model_access_rights/static/description/assets/screenshots/v16-hero.gif b/model_access_rights/static/description/assets/screenshots/v16-hero.gif new file mode 100644 index 000000000..f9205387b Binary files /dev/null and b/model_access_rights/static/description/assets/screenshots/v16-hero.gif differ diff --git a/model_access_rights/static/description/banner.png b/model_access_rights/static/description/banner.png new file mode 100644 index 000000000..1b57f61b3 Binary files /dev/null and b/model_access_rights/static/description/banner.png 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..51e28ec44 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..d6c1e3d5b --- /dev/null +++ b/model_access_rights/static/description/index.html @@ -0,0 +1,571 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Model Access Rights

+

Hide the Options

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

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 'Model Access Config'

+ +
+ +
+

To show an example, set Marc Demo as the User in the purchase module

+ +
+ +
+

Select the model, group and the option which we want to hide

+ +
+
+

We can see create option is hidden in purchase.order to those who are User + in purchase module

+ +
+ +
+

Set the access right of Marc Demo as User in project module

+ +
+
+

By default we can see Export and Archive/UnArchive options

+ +
+
+

Select the options which we want to hide

+ +
+
+

Export and Archive/UnArchive functionality are hidden

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

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..1ddb634fe --- /dev/null +++ b/model_access_rights/static/src/js/form_controller.js @@ -0,0 +1,46 @@ +/** @odoo-module */ +/** + * This file will used to hide the selected options from the form view + */ +import { FormController} from "@web/views/form/form_controller"; +import { patch} from "@web/core/utils/patch"; +var rpc = require('web.rpc'); +const { onWillStart} = owl; +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 + */ + setup() { + this._super(); + onWillStart(async () => { + var self = this + var result; + await rpc.query({ + model: 'access.right', + method: 'hide_buttons', + }).then(function(data) { + result = data; + }); + for (var i = 0; i < result.length; i++) { + var group = result[i].module + "." + result[i].group_name + if (self.props.resModel == result[i].model) { + if (await self.user.hasGroup(group)) { + if (!this.user.isAdmin) { + if (result[i].is_create_or_update) { + self.canCreate = false + } + if (result[i].is_delete) { + this.archInfo.activeActions.delete = false + } + if (result[i].is_archive) { + self.archiveEnabled = false + } else { + self.archiveEnabled = true; + } + } + } + } + } + }); + } +}); \ No newline at end of file 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..b08198d05 --- /dev/null +++ b/model_access_rights/static/src/js/list_controller.js @@ -0,0 +1,50 @@ +/** @odoo-module */ +/** + * This file will used to hide the selected options from the list view + */ +import { ListController} from '@web/views/list/list_controller'; +import { patch} from "@web/core/utils/patch"; +var rpc = require('web.rpc'); +const {onWillStart} = owl; +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 + */ + setup() { + this._super(); + onWillStart(async () => { + var self = this + var result; + await rpc.query({ + model: 'access.right', + method: 'hide_buttons', + }).then(function(data) { + result = data; + }); + for (var i = 0; i < result.length; i++) { + var group = result[i].module + "." + result[i].group_name + if (self.props.resModel == result[i].model) { + if (await self.userService.hasGroup(group)) { + if (!this.userService.isAdmin) { + if (result[i].is_create_or_update) { + self.activeActions.create = false; + } + if (result[i].is_export) { + self.isExportEnable = false + self.isExportEnable = false + } + if (result[i].is_delete) { + self.activeActions.delete = false; + } + if (result[i].is_archive) { + self.archiveEnabled = false; + } else { + self.archiveEnabled = true; + } + } + } + } + } + }); + } +}); \ No newline at end of file diff --git a/model_access_rights/views/model_access_rights_views.xml b/model_access_rights/views/model_access_rights_views.xml new file mode 100644 index 000000000..36c0c3457 --- /dev/null +++ b/model_access_rights/views/model_access_rights_views.xml @@ -0,0 +1,60 @@ + + + + Model Access Right + access.right + tree,form + + + + module.access.rights.tree + access.right + + + + + + + + + + + + + + module.access.rights.views + access.right + +
+ +

+ +

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