0

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
Sofiane Mdj
  • 63
  • 2
  • 10

3 Answers3

0

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.

Kenly
  • 24,317
  • 7
  • 44
  • 60
  • the thing is , when i install my medul i got this problem ! i take it off , erros gone ! !! i notice one thing if i replace the many2many field with float or anything , there no problems ! so my comodel is causing that problem ! but why ? – Sofiane Mdj Feb 04 '18 at 15:08
  • any luck ?! cause ive been working on odoo like more than a year and half ! sometimes i got errors i cnt explain ! – Sofiane Mdj Feb 04 '18 at 15:35
  • @Zety !! i tried everything log in out ! down database , and create a new one ! still have that error ! – Sofiane Mdj Feb 04 '18 at 15:50
0

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.

Navi
  • 1,000
  • 1
  • 14
  • 44
0

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
Rinaldi
  • 260
  • 3
  • 9