Hello,
I added some customed fields by classic inheritance in the res.users model, as follows :
class TrelloUsers(models.Model):
_inherit='res.users'
trello_api_key=fields.Char('Trello API Key')
trello_secret_token=fields.Char('Trello Secret Token')
Then, I modified the "Preferences" view to add those fields :
<record id="trello_view_preference_form" model="ir.ui.view">
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
<field name="arch" type="xml">
<xpath expr="//group[3]" position="after">
<group string="Trello Settings">
<field string="API Key" name="trello_api_key" readonly="0" />
<field string="Secret Token" name="trello_secret_token" readonly="0" />
</group>
</xpath>
</field>
</record>
It aims at allowing the concerned user to specify the data in those fields. But when I try to modify those data as an employee user, instead of admin user, I get an access error stating that only admins can modify these fields.
Odoo Server Error - Access Error
Sorry, you are not allowed to modify this document. Only users with the following access level are currently allowed to do that:
- Administration/Access Rights(Document model: res.users)
I can’t find information about how to give a user the necessary rights to modify some fields in the res.users model, but still make sure they can’t modify data of other users.
Thanks.
Cyrille (La LibreRie)