<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="action_view_issue_business_requirement" model="ir.actions.act_window">
            <field name="res_model">project.issue</field>
            <field name="view_type">form</field>
            <field name="name">Issues Related BR</field>
            <field name="view_mode">tree,form</field>
            <field name="context">{
                'search_default_business_requirement_id': [active_id],
                'default_business_requirement_id': active_id
            }</field>
        </record>
        <record id="view_br_form_issues" model="ir.ui.view">
            <field name="name">view.br.issue.form</field>
            <field name="model">business.requirement</field>
            <field name='inherit_id' ref='business_requirement.view_business_requirement_form'/>
            <field name="arch" type="xml">
                <xpath expr="//div[@name='buttons']"
                       position="inside">
                    <button class="oe_stat_button"
                            type="action"
                            name="%(action_view_issue_business_requirement)d"
                            icon="fa-bug"
                            context="{'business_requirement_id': id}">
                        <field string="Issues"
                               name="issue_count"
                               widget="statinfo"/>
                    </button>
                </xpath>
            </field>
        </record>
    </data>
</openerp>
