Skip to Content
Menu
This question has been flagged

I have been looking around for a solution to problem as suggested in the title of this question.  I am setting up an odoo 11 (odoo official docker installation) instance and have managed to configure it to quite an extent. However, while evaluating the sales workflow for non  admin users I am stumbling upon the ubiquitous access rules issue when hitting on the "Send by Mail" button. The feature works flawlessly when working as admin but I obviously don't want to be carrying out sales / crm activities as admin. 

I am inclined to believe that the issue clearly has something to do with "record rules" or "access control list" but I am not sure where to look and which objects to tinker with in the given context.

Upon looking at the console log in the browser I find the following error message which also clearly reflect lacking access rights for non-admin users:

Server application error{"data":{"name":"odoo.exceptions.AccessError","exception_type":"access_error","message":"The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: Email composition wizard, Operation: create)\nNone","arguments":["The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: Email composition wizard, Operation: create)",null],"debug":"Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 651, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 310, in _handle_exception\n raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])\n File \"/usr/lib/python3/dist-packages/odoo/tools/pycompat.py\", line 87, in reraise\n raise value\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 693, in dispatch\n result = self._call_function(**self.params)\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 342, in _call_function\n return checked_call(self.db, *args, **kwargs)\n File \"/usr/lib/python3/dist-packages/odoo/service/model.py\", line 97, in wrapper\n return f(dbname, *args, **kwargs)\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 335, in checked_call\n result = self.endpoint(*a, **kw)\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 937, in __call__\n return self.method(*args, **kw)\n File \"/usr/lib/python3/dist-packages/odoo/http.py\", line 515, in response_wrap\n response = f(*args, **kw)\n File \"/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py\", line 934, in call_kw\n return self._call_kw(model, method, args, kwargs)\n File \"/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py\", line 926, in _call_kw\n return call_kw(request.env[model], method, args, kwargs)\n File \"/usr/lib/python3/dist-packages/odoo/api.py\", line 687, in call_kw\n return call_kw_model(method, model, args, kwargs)\n File \"/usr/lib/python3/dist-packages/odoo/api.py\", line 672, in call_kw_model\n result = method(recs, *args, **kwargs)\n File \"/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_message.py\", line 781, in create\n message = super(Message, self).create(values)\n File \"/usr/lib/python3/dist-packages/odoo/models.py\", line 3377, in create\n record = self.browse(self._create(old_vals))\n File \"/usr/lib/python3/dist-packages/odoo/models.py\", line 3536, in _create\n self.check_access_rule('create')\n File \"/usr/lib/python3/dist-packages/odoo/addons/mail/wizard/mail_compose_message.py\", line 147, in check_access_rule\n return super(MailComposer, self).check_access_rule(operation)\n File \"/usr/lib/python3/dist-packages/odoo/addons/website_mail/models/mail_message.py\", line 58, in check_access_rule\n return super(MailMessage, self).check_access_rule(operation=operation)\n File \"/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_message.py\", line 699, in check_access_rule\n (self._description, operation))\nodoo.exceptions.AccessError: ('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\\n\\n(Document type: Email composition wizard, Operation: create)', None)\n"},"message":"Odoo Server Error","code":200}

It seems to me that this issue has been experienced and tackled in the past but I unfortunately could not find any references for the identical issue for version 11 (CE).

https://github.com/odoo/odoo/issues/4437

I am pretty much at the end of my wits and don't quite know how to proceed ahead as the issue would be a complete show stopper for my deployment. I really do hope and pray that someone has a solution to this issue.

P.S: The currently setup environment is a multi-company (although I am just using one company as of now but intend to setup a couple of them once this  feature is up and running).

Many thanks in advance


Avatar
Discard
Author Best Answer

Hi Niyas,

Many thanks for your tips and insights regarding the error. I was quite aware that I had to tinker around with the Access Control List / Record Rule. However was not sure what model i should have been looking for. After going through various failed permutations with the access list and record rules it turned up that the problem lay quite somewhere else. I had installed the set of mail addons by https://it-project.info that provide the older folder odoo email folder structure (sent, archives, all mail) as well as the possibilty to reply to emails (mail_reply) which anyways didn't work.

I just gave it a shot and uninstalled the mail_base module that comes as a dependency for the above modules and lo and behold, the problem was solved.

Just in case someone has the same constellation as me, this information may come in handy.

best regards

Avatar
Discard
Best Answer

Hi,

As you specified in the question, this issue can  be sorted out using the Access Control List or by the Record rules. Right now for the specified model in the error message have no access rights, so we are getting this error message.

Just activate the developer mode and navigate to the Settings -> Technical -> Security -> Access Control List/ Record Rules and filter the rules based on this model and adjust the given rules for the corresponding model by changing the permissions or by keeping some rules to set active=False and see which rule is causing the issue.


If you feel that the issue is coming by default in odoo, without any custom addons or due to the alterations of the rules, try to reproduce the issue in the odoo runbot, if you are able to reproduce the issue with the same set up you have done in the local, report it at: https://github.com/odoo/odoo/issues


Thanks

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 23
1316
1
Jun 23
1436
1
Sep 18
1670
1
Jun 24
2230
5
May 23
48625