Odoo Help

Welcome!

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.

0

same one can explain to me this fragment of sourse

By
Ait-Mlouk Addi
on 10/4/13, 1:23 PM 865 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'))]"/> 
    </record>

eval =...

0
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:

 Values: 
     (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.

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

0 follower(s)

Stats

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