<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Copyright 2017-19 Eficent Business and IT Consulting Services S.L.
 License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

    <record id="qc_team_view_kanban" model="ir.ui.view" >
        <field name="name">qc.team.dashboard</field>
        <field name="model">qc.team</field>
        <field name="arch" type="xml">
            <kanban class="o_kanban_dashboard oe_background_grey" create="0">
                <field name="name"/>
                <field name="user_id"/>
                <field name="member_ids"/>
                <field name="color"/>
                <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="#{kanban_color(record.color.raw_value)}">
                            <div class="o_kanban_card_header">
                                <div class="o_kanban_card_header_title">
                                    <div class="o_primary"><field name="name"/></div>
                                </div>
                                <div class="o_kanban_manage_button_section">
                                    <a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
                                </div>
                            </div>
                            <div class="container o_kanban_card_content">
                                <div class="row o_kanban_card_upper_content">
                                    <div class="col-6 o_kanban_primary_left" name="card_left"/>
                                    <div class="col-6 o_kanban_primary_right" name="card_right"/>
                                </div>
                            </div>

                            <div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
                                <div t-if="widget.editable" class="o_kanban_card_manage_settings row" groups="quality_control.group_quality_control_manager">
                                    <div role="menuitem" aria-haspopup="true" class="col-8">
                                        <ul class="oe_kanban_colorpicker" data-field="color" role="menu"/>
                                    </div>
                                    <div role="menuitem" class="col-4 text-right">
                                        <a type="edit">Settings</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>

    <record id="qc_team_search" model="ir.ui.view">
        <field name="name">Case Teams - Search</field>
        <field name="model">qc.team</field>
        <field name="arch" type="xml">
            <search string="QC teams Search">
                <field name="name"/>
                <field name="user_id"/>
                <filter name="personal" string="My Teams"
                        domain="['|', ('member_ids', '=', uid), ('user_id', '=', uid)]"/>
                <group expand="0" string="Group By...">
                    <filter name="group_user_id" string="Team Leader" domain="[]" context="{'group_by':'user_id'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="qc_team_dashboard_act" model="ir.actions.act_window">
        <field name="name">Dashboard</field>
        <field name="res_model">qc.team</field>
        <field name="view_type">form</field>
        <field name="view_mode">kanban,form</field>
        <field name="context">{'search_default_personal':1}</field>
        <field name="help" type="html">
            <p>Define a new quality control teams going to <b><i>Configuration >
                Quality Control Teams</i></b>.
            </p>
        </field>
    </record>

    <menuitem id="menu_qc_team_act" action="qc_team_dashboard_act"
              sequence="1" parent="quality_control.qc_menu" name="Dashboard"/>

</odoo>
