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

    <record model="ir.actions.act_window" id="team_qc_issue_act">
        <field name="name">Issues by team</field>
        <field name="res_model">qc.issue</field>
        <field name="view_mode">kanban,tree,form,pivot</field>
        <field name="context">{
                'search_default_qc_team_id': [active_id],
                'default_qc_team_id': active_id,
                'default_user_id': uid,
            }
        </field>
        <field name="help" type="html">
            <p>Manage Quality Control Issues through your team flow.</p>
        </field>
    </record>

    <record model="ir.actions.act_window" id="team_qc_problem_act">
        <field name="name">Problem tracking</field>
        <field name="res_model">qc.problem</field>
        <field name="view_mode">kanban,tree,form,pivot</field>
        <field name="context">{
                'search_default_qc_team_id': [active_id],
                'default_qc_team_id': active_id,
                'default_user_id': uid,
            }
        </field>
        <field name="help" type="html">
            <p>Track problems through your team flow.</p>
        </field>
    </record>

    <record id="qc_team_view_kanban" model="ir.ui.view" >
        <field name="name">qc.team.dashboard - quality_control_issue</field>
        <field name="model">qc.team</field>
        <field name="inherit_id" ref="quality_control_team.qc_team_view_kanban"/>
        <field name="arch" type="xml">

            <xpath expr="//div[@name='card_left']" position="inside">
                <button class="btn btn-primary" type="action"
                        name="%(team_qc_issue_act)d">Issues
                </button>
            </xpath>
            <xpath expr="//div[@name='card_right']" position="inside">
               <button class="btn btn-primary" type="action"
                        name="%(team_qc_problem_act)d">Problems
                </button>
            </xpath>

        </field>
    </record>

</odoo>
