Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Extend user settings dialog

Mark Zeller
on 8/18/14, 11:19 AM 695 views


I want to add a new attribute (like the email-address for example) to res.users making it possible for every user to update this attribute in his user settings dialog (upper right corner).

To make it short, everythings works as expected with the exception that only the administrator is able to edit this attribute in the user settings screen. For every one else it is read only.

Basically I added the new attribute to res.users

class res_users(osv.osv):
    _inherit = 'res.users
    _columns = {
        'color': fields.char('Color (hex)', size=6),

And extended the view like this

<record id="view_user_my_settings_form" model="ir.ui.view">
    <field name="name">res.users.preferences.form.inherit</field>
    <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[@name='preferences']" position="inside">
                <field name="color"/>

Any idea what I missed?




Thanks to Ben Bernard I discovered my mistake. After forcing the field to writeable mode I got an error that the user is not allowed to change res.users. So my solution is to move the attribute from res.users to res.partner.


Ben Bernard

--Ben Bernard--
| 4 3 6
Jakarta, Indonesia
--Ben Bernard--
Ben Bernard
On 8/18/14, 1:33 PM

<field name="color" readonly="0"/>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 8/18/14, 11:19 AM
Seen: 695 times
Last updated: 3/16/15, 8:10 AM