Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
Discuss (mail)
|
Lines of code | 128 |
Technical Name |
hide_portal_module_by_user |
License | AGPL-3 |
Website | https://github.com/AxeldelosReyes/odoo_web_modules |
Hide Portal Module By User
Show / Hide Specific Portal Docs on res.users
IMPORTANT
!! IMPORTANT !!
This module doesnt modify the access rights of the users, it only hides the documents.
This Module will Allow to enter a specific document via URL even when the user does not have the group assigned to it.
REVIEW YOUR USE CASES
Example:
if you dont have the group assigned to it.
- you can access to the document via URL: /my/orders/6?access_token=0f13c269-0f10-46dc-81f8-4db9682f2267
- but not to my/orders
PLEASE MAKE A PR IF YOU I MISSED TO WHITELIST A ROUTE URL
Usage
To use this module, you need to:
- Install and Configure the Groups and Users





How it Works
- At Installation, the module will search for all the views that inherits portal.portal_my_home and create a group based on the URL that its linked to in the anchor tag.
- Post Installation, the module will detect if a new view is created inheriting the portal home and create the group.
- We Add a validation at view level to hide the group and a validation when trying to list the portal documents.
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedThere are no ratings yet!
getting errer when try to install RPC_ERROR Odoo Server Error Traceback (most recent call last): File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/addons/base/models/ir_http.py", line 242, in _dispatch result = request.dispatch() File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/http.py", line 702, in dispatch result = self._call_function(**self.params) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/http.py", line 368, in _call_function return checked_call(self.db, *args, **kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/http.py", line 357, in checked_call result = self.endpoint(*a, **kw) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/http.py", line 925, in __call__ return self.method(*args, **kw) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/http.py", line 546, in response_wrap response = f(*args, **kw) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/addons/web/controllers/main.py", line 1328, in call_button action = self._call_kw(model, method, args, kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/custom_addons/lawazem/Odoo/printnode_base/controllers/main.py", line 43, in _call_kw return super(DataSetProxy, self)._call_kw(model, method, args, kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/addons/web/controllers/main.py", line 1316, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/api.py", line 471, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/api.py", line 456, in _call_kw_multi result = method(recs, *args, **kwargs) File "<decorator-gen-76>", line 2, in button_immediate_install File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/addons/base/models/ir_module.py", line 72, in check_and_log return method(self, *args, **kwargs) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/addons/base/models/ir_module.py", line 470, in button_immediate_install return self._button_immediate_function(self.env.registry[self._name].button_install) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/addons/base/models/ir_module.py", line 587, in _button_immediate_function registry = modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/modules/registry.py", line 88, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/modules/loading.py", line 474, in load_modules processed_modules += load_marked_modules(cr, graph, File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/modules/loading.py", line 363, in load_marked_modules loaded, processed = load_module_graph( File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/modules/loading.py", line 240, in load_module_graph getattr(py_module, post_init)(cr, registry) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/custom_addons/lawazem/Odoo/hide_portal_module_by_user/hooks.py", line 16, in post_init_hook p.create_group_from_view() File "/Users/amrwahba/Desktop/ERP/15.0/odoo/custom_addons/lawazem/Odoo/hide_portal_module_by_user/models/ir_ui_view.py", line 47, in create_group_from_view target_url = target_url.get('t-value').replace("'", '') Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/amrwahba/Desktop/ERP/15.0/odoo/custom_addons/lawazem/Odoo/api_extend/http/ir_http.py", line 15, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/Users/amrwahba/Desktop/ERP/15.0/odoo/odoo/http.py", line 301, in _handle_exception raise exception.with_traceback(None) from new_cause AttributeError: 'NoneType' object has no attribute 'replace'