Odoo Help


[SOLVED] Groups definition using XML.

Pau Ubach
on 10/24/14, 5:59 AM 1,513 views

I want to create groups when installing my module:

        <record id="bdt_group_dpc" model="res.groups">
            <field name="name">Users: DPC</field>
            <field name="category_id" eval="bdt_category_department"/>

Then I can add access rights:

            <record id="bdt_access_bdd_res_partner_currency" model="ir.model.access">
                <field name="name">res partner currency</field>
                <field name="model_id" ref="request_project.model_res_partner_currency"/>
                <field name="perm_read">1</field>
                <field name="perm_write">1</field>
                <field name="perm_unlink">1</field>
                <field name="perm_create">1</field>
                <field name="group_id" eval="bdt_group_bdd"/>

But I don't know how to add rows in inherited tab.

It is used implied_ids, but this is defined in an object (that inherits from res_groups) without field _name and it's in the table res_groups_implied_ids, but I don't know how to add anything there.


Actually my problem is with all many2many fields. I don't know how to access the relation table.




| 5 4 6
Zagreb | Karlovac, Croatia

there is only 10 kind of people the ones that understand binary ... and others

On 10/24/14, 8:55 AM

use the same fdorm as in python code, only here you need to eval the expression.. like:

<field name="implied_ids" eval="[(4, ref('bdt_group_dpc'))]"/>


hope it helps


check xml files in security folders of bigger modules/aplications and look for examples 

Thank you!! By the way, do you know why does it have number 4? What does it mean?

Pau Ubach
on 10/26/14, 9:31 PM

jes, it creates link to existing record with external id bdt_group_dpc... find more in fields definitions, look for many2many field and write method... it expects some tuples... in wich the first number defines type of write action to do... 0 creates new record... etc

on 10/27/14, 3:30 AM

Very useful to know. Thanks.

Pau Ubach
on 10/27/14, 3:31 AM

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

1 follower(s)


Asked: 10/24/14, 5:59 AM
Seen: 1513 times
Last updated: 3/16/15, 8:10 AM