<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2010 NaN Projectes de Programari Lliure, S.L.
    Copyright 2014 Serv. Tec. Avanzados - Pedro M. Baeza
    Copyright 2014 Oihane Crucelaegui - AvanzOSC
    Copyright 2017 Eficent Business and IT Consulting Services S.L.
    Copyright 2017 Simone Rubino - Agile Business Group
    License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

    <record model="ir.module.category" id="module_category_quality_control">
        <field name="name">Quality control</field>
    </record>

    <record id="group_quality_control_user" model="res.groups">
        <field name="name">User</field>
        <field name="category_id" ref="module_category_quality_control"/>
    </record>

    <record id="group_quality_control_manager" model="res.groups">
        <field name="name">Manager</field>
        <field name="category_id" ref="module_category_quality_control"/>
        <field name="implied_ids" eval="[(4, ref('group_quality_control_user'))]"/>
        <field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
    </record>

    <record id="qc_test_multi_company_rule" model="ir.rule">
        <field name="name">Quality control test multi-company</field>
        <field name="model_id" ref="model_qc_test"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
    </record>

    <record id="qc_inspection_multi_company_rule" model="ir.rule">
        <field name="name">Quality control inspection multi-company</field>
        <field name="model_id" ref="model_qc_inspection"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
    </record>

    <record id="qc_trigger_multi_company_rule" model="ir.rule">
        <field name="name">Quality control trigger multi-company</field>
        <field name="model_id" ref="model_qc_trigger"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]</field>
    </record>

</odoo>
