Odoo Aide


4 Answers
john doe
07/11/2017 09:58

I'm working on the same issue.

Tip: Start here: Odoo 10.0\server\odoo\addons\base\security\base_security.xml

Here you may see interesting code:

    <record model="ir.rule" id="res_partner_rule">
            <field name="name">res.partner company</field>
            <field name="model_id" ref="model_res_partner"/>
                Show partners from ancestors and descendants companies
                (or company-less), this is usually a better default for
                multicompany setups.
            <field name="domain_force">['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
            <field name="active" eval="False"/>

Also you might find it useful: https://www.odoo.com/forum/how-to/developers-13/setting-up-rules-access-right-in-xml-csv-files-12667

Raaj Mishra
30/10/2017 09:09

You can use Odoo access rules feature to achieve that.Also you can inherit search method for the objects and you can use the domain based on your requirement at the method to have the functionality.

22/04/2019 06:30


This would help.

<record id="current_company_vendors" model="ir.rule">

        <field name="name">Current Company Partners</field>

        <field name="model_id" ref="base.model_res_partner"/>

        <field name="global" eval="True"/>

        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>



Matīss Jēkabsons
03/11/2017 09:52

Bought some books about Odoo.. but still didn't get an manual for creating such a thing :/

Poser une question
Keep Informed
2 Abonné(e)s
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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now