<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="group_business_requirement_user" model="res.groups">
        <field name="name">Business Requirement User</field>
        <field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
        <field
            name="category_id"
            ref="business_requirement.module_category_business_requirement"
        />
        <field
            name="users"
            eval="[(4, ref('base.user_admin')), (4, ref('base.user_root'))]"
        />
    </record>
    <record id="group_business_requirement_manager" model="res.groups">
        <field name="name">Business Requirement Manager</field>
        <field
            name="implied_ids"
            eval="[(4, ref('business_requirement.group_business_requirement_user'))]"
        />
        <field
            name="category_id"
            ref="business_requirement.module_category_business_requirement"
        />
        <field
            name="users"
            eval="[(4, ref('base.user_admin')), (4, ref('base.user_root'))]"
        />
    </record>
    <record id="rule_business_requirement" model="ir.rule">
        <field name="name">Business Requirement</field>
        <field name="model_id" ref="model_business_requirement" />
        <field name="global" eval="True" />
        <field name="domain_force">
            ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]
        </field>
    </record>
    <!-- Portal -->
    <record id="br_rule_portal" model="ir.rule">
        <field name="name">BR: portal users: portal and following</field>
        <field name="model_id" ref="business_requirement.model_business_requirement" />
        <field name="domain_force">[
           '&amp;',
               ('portal_published', '=', True),
               ('message_partner_ids', 'child_of', [user.partner_id.commercial_partner_id.id]),
       ]</field>
        <field name="groups" eval="[(4, ref('base.group_portal'))]" />
    </record>
</odoo>
