Odoo Help


same one can explain to me this fragment of sourse

Ait-Mlouk Addi
on 10/4/13, 1:23 PM 1,394 views

Hi same one can explain to me this fragment of sourse

<record id="base.user_demo" model="res.users">
            <field name="groups_id" eval="[(4,ref('base.group_document_user'))]"/> 

eval =...

martin mueller
On 10/4/13, 4:12 PM

In your code eval means that the enclosed expression will be evaluted by the field object. In this case, it means that the base.group_document_user id will be added to the groups_id of the user with id base.user_demo. The meaning of the code (here 4) is:

     (0, 0,  { fields })    create
     (1, ID, { fields })    update (write fields to ID)
     (2, ID)                remove (calls unlink on ID, that will also delete the 
                            relationship because of the ondelete)
     (3, ID)                unlink (delete the relationship between
                            the two objects but does not delete ID)
     (4, ID)                link (add a relationship)
     (5, ID)                unlink all
     (6, ?, ids)            set a list of links

This is described in the fields.py file and probably somewhere in the documentation, but I could not find it.

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 10/4/13, 1:23 PM
Seen: 1394 times
Last updated: 3/16/15, 8:10 AM