0
votes

i hope i got an answer ! after inheriting res.users model

#-*- coding: utf-8 -*-

from openerp import fields, models, api

class res_users_list(models.Model):

    _inherit='res.users'


    price_list = fields.Many2many(string='Listes de prix autorisees' ,comodel_name ='product.pricelist')

i wanna give some users a list of allowed pricelists ! here's the view :

 <record id="view_price_list_inherited_from" model="ir.ui.view">
  <field name="name">res.users.form.inherited</field>
  <field name="model">res.users</field>
  <field name="inherit_id" ref="base.user_groups_view"/>
  <field name="arch" type="xml">

    <xpath expr="//separator[@string='Application']" position="after">

      <field name="price_list"
     widget="many2many_tags"
     />
      <newline/>
      </xpath>

  </field>
</record>

once i log in , i have this error

enter image description here

i really hope someone explain to me ! or a solution to get rid of this Access error "AccessError

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: res.users, Operation: read) "

thnx all guys for the quick reply ! here's mi ir.model.access.csv :

id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink

access_price_list_filter,User_price_list_filter.price_list_filter,base.model_res_partner,base.group_sale_salesman,1,1,1,1

access_price_list_filter1,User_price_list_filter1.price_list_filter,base.model_res_users,base.group_sale_salesman,1,1,1,1
access_price_list_filter2,User_price_list_filter2.price_list_filter,product.model_product_pricelist,base.group_sale_salesman,1,1,1,1
3
I think you need to add security file, and give the model res.user the access readkhelili miliana
Hi @Sofiane Mdj, I can help you, just i need to know the group of this userkhelili miliana
To get the group you need to activate debug mode, by adding ?debug after /webkhelili miliana
Check your inbox message and replie us, I don't waste a time to such questionkhelili miliana
sorry for the late reply , iwas trying to check what you guys were telling me to do ! i really appreciate ! i just updated my post adding my security file !Sofiane Mdj

3 Answers

0
votes

add this:

access_price_list_filter3,User_price_list_filter3.price_list_filter,model_res_users_list,base.group_sale_salesman,1,1,1,1
0
votes

You can fix this error. Whenever you see an error like this Document type: model.name, Operation: read.

Just do these things:

The given access rights in your .csv file or the xml file were not correct or not given in the correct module.

or

There will not be any access rights given to that concerned module.

or

There will be a mistake in the record rule which mismatches with access right.

or

Any unnecessary required field is given(It sometimes do really cause this error).

I am sure that this will fix your error.

0
votes

You need to have read access (write access if you want to edit) to res.users for user sos.

This can happen when a user belongs to a group that restricts read access to the res.users object.