0
votes

I have a field on my object have a relation with res.users when I use the administrator session to connect the field user_id dropdown shows me a list of users but when I was contacted by another user the dropdown empty I have created access to group user to read res_useres object but nothing happened

this is my object

 class user_messaging(models.Model):
   _name = 'user.messaging'
   _inherit = 'mail.thread'
   user_id = fields.Many2one('res.users', 'user', required=True, ondelete="restrict",
                             track_visibility="onchange" , domain="[('is_teacher','=', True)]")

what can I do is there any solution? can I put a list of users using self. pool. get and put on user_id?? odoo v8

1
usergroup_access_messaging_res_users_all,usergroup_access_messaging_res_users_all user,base.model_res_users,mymodule.user_access,1,1,1,1Caludio
I add to the file security also I add in the configuration manually to be sure on odoo access control listCaludio
Yes I add many of users to this groupCaludio

1 Answers

0
votes

Add an ir.rule record for that group mymodule.user_access with a domain_force value of [(1,'=',1)]

Like:

<record id="usergroup_access_messaging_res_users_all" model="ir.rule">
    <field name="name">usergroup_access_messaging_res_users_all</field>
    <field name="model_id" ref="base.model_res_users"/>
    <field name="domain_force">[(1,'=',1)]</field>
    <field name="perm_read" eval="True"/>
    <field name="perm_write" eval="True"/>
    <field name="perm_create" eval="True"/>
    <field name="perm_unlink" eval="True"/>
    <field name="groups" eval="[(4, ref('mymodule.user_access'))]"/>
</record>