OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

The requested operation cannot be completed due to security restrictions

  • Thread starter Thread starter Ayyappan Subramaniyan
  • Start date Start date
A

Ayyappan Subramaniyan

Guest
I have created new add-on as like as survey add-on. Module consist 3 level of groups,

  1. Head Manager(admin)
  2. Manager
  3. User

If i am logged in as a manager and print the report, i am getting below warning,

Code:
"AccessError: ('AccessError', u'The requested operation cannot be completed due to security restrictions.
Please contact your system administrator.\n\n(Document type: res.partner, Operation: read)') "

My rules are:

Manager:​


Code:
<record model="res.groups" id="base.group_survey_manager">
<field name="name">Custom Survey  Manager</field>
<field name="implied_ids" eval="[(4, ref('base.group_survey_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>


Code:
<record id="project_survey_manager_access" model="ir.rule">
<field name="name">Survey Manager access rights</field>
<field name="model_id" ref="custom_survey.model_custom_project_survey"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('base.group_survey_manager'))]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>

Partner Form Security:​


Code:
<record id="partner_list_access" model="ir.rule">
        <field name="name">Access to the manager to list related partners</field>
        <field name="model_id" ref="base.model_res_partner"/>
        <field name="domain_force">[('create_uid', '=', user.id)]</field>            
        <field name="groups" eval="[(4, ref('base.group_survey_manager'))]"/>
    </record>

If the manager is logged-in, i would like to list the partner who is created by the current manager. That's why i added the partner rule.

How to solve this issue?
<p>I have created new add-on as like as survey add-on. Module consist 3 level of groups,</p>

<ol>
<li>Head Manager(admin)</li>
<li>Manager</li>
<li>User</li>
</ol>

<p>If i am logged in as a manager and print the report, i am getting below warning,</p>

<pre><code>"AccessError: ('AccessError', u'The requested operation cannot be completed due to security restrictions.
Please contact your system administrator.\n\n(Document type: res.partner, Operation: read)') "
</code></pre>

<p>My rules are:</p>

<h2>Manager:</h2>

<pre><code><record model="res.groups" id="base.group_survey_manager">
<field name="name">Custom Survey Manager</field>
<field name="implied_ids" eval="[(4, ref('base.group_survey_user'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
</code></pre>

<hr>

<pre><code><record id="project_survey_manager_access" model="ir.rule">
<field name="name">Survey Manager access rights</field>
<field name="model_id" ref="custom_survey.model_custom_project_survey"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('base.group_survey_manager'))]"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_create"/>
</record>
</code></pre>

<h2>Partner Form Security:</h2>

<pre><code><record id="partner_list_access" model="ir.rule">
<field name="name">Access to the manager to list related partners</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="domain_force">[('create_uid', '=', user.id)]</field>
<field name="groups" eval="[(4, ref('base.group_survey_manager'))]"/>
</record>
</code></pre>

<p>If the manager is logged-in, i would like to list the partner who is created by the current manager. That's why i added the partner rule.</p>

<p>How to solve this issue?</p>
Continue reading...
 

Latest posts

Top