<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="act_view_sub_br_all" model="ir.actions.act_window">
        <field name="name">Business Requirement</field>
        <field name="res_model">business.requirement</field>
        <field name="view_mode">tree,form</field>
    </record>
    <record id="view_business_requirement_form" model="ir.ui.view">
        <field name="name">business.requirement.form</field>
        <field name="model">business.requirement</field>
        <field name="type">form</field>
        <field name="priority">20</field>
        <field name="arch" type="xml">
            <form string="Business Requirement">
                <header>
                    <field
                        name="state"
                        widget="statusbar"
                        clickable="True"
                        statusbar_visible="draft,confirmed,approved,in_progress,done,cancel,drop"
                    />
                </header>
                <sheet>
                    <div
                        class="oe_button_box"
                        name="button_box"
                        groups="base.group_user"
                    >
                        <button
                            class="oe_stat_button"
                            name="portal_publish_button"
                            type="object"
                            icon="fa-globe"
                        >
                            <label for="portal_published" />
                            <field name="portal_published" widget="toggle_button" />
                        </button>
                    </div>
                    <div class="oe_left">
                        <field
                            name="kanban_state"
                            class="oe_inline"
                            widget="kanban_state_selection"
                        />
                    </div>
                    <h1>
                        <field name="name" class="oe_inline" readonly="1" /> -
                        <field name="description" default_focus="1" />
                    </h1>
                    <group col="4">
                        <field name="responsible_user_id" required="1" />
                        <field name="partner_id" />
                        <field name="origin" />
                        <field name="category_ids" widget="many2many_tags" />
                        <field name="to_be_reviewed" />
                        <field name="reviewer_ids" widget="many2many_tags" />
                        <field
                            name="priority"
                            groups="base.group_user"
                            widget="priority"
                        />
                    </group>
                    <notebook>
                        <page string="Business Requirement">
                            <group string="Stakeholder Story">
                                <field
                                    name="business_requirement"
                                    nolabel="1"
                                    colspan="2"
                                />
                            </group>
                            <group string="Scenario">
                                <field name="scenario" nolabel="1" colspan="2" />
                            </group>
                            <group string="Gap">
                                <field name="gap" nolabel="1" colspan="2" />
                            </group>
                            <group string="Test Case">
                                <field name="test_case" nolabel="1" colspan="2" />
                            </group>
                            <group string="Terms and Conditions">
                                <field
                                    name="terms_and_conditions"
                                    nolabel="1"
                                    colspan="2"
                                />
                            </group>
                        </page>
                        <page string="Logs" name="logs">
                            <group col="4">
                                <field name="user_id" />
                                <field name="date" />
                                <field name="create_uid" readonly="1" />
                                <field
                                    name="create_date"
                                    string="Creation Date"
                                    readonly="1"
                                />
                                <field name="confirmed_user_id" />
                                <field name="confirmation_date" />
                                <field name="approved_id" />
                                <field name="approval_date" />
                            </group>
                        </page>
                        <page string="Other" name="other">
                            <group col="4">
                                <field name="requested_user_id" />
                                <field name="change_request" />
                                <field
                                    name="company_id"
                                    groups="base.group_multi_company"
                                />
                            </group>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field
                        name="message_follower_ids"
                        widget="mail_followers"
                        groups="base.group_user"
                    />
                    <field name="activity_ids" widget="mail_activity" />
                    <field name="message_ids" widget="mail_thread" />
                </div>
            </form>
        </field>
    </record>
    <record id="view_business_requirement_tree" model="ir.ui.view">
        <field name="name">business.requirement.tree</field>
        <field name="model">business.requirement</field>
        <field name="arch" type="xml">
            <tree>
                <field name="responsible_user_id" />
                <field name="partner_id" />
                <field name="name" />
                <field name="description" />
                <field name="category_ids" />
                <field name="priority" />
                <field name="state" />
            </tree>
        </field>
    </record>
    <record model="ir.ui.view" id="view_business_requirement_kanban_project">
        <field name="name">business.requirement.kanban</field>
        <field name="model">business.requirement</field>
        <field name="arch" type="xml">
            <kanban default_group_by="state">
                <field name="state" />
                <field name="name" />
                <field name="description" />
                <field name="responsible_user_id" />
                <field name="category_ids" />
                <field name="priority" />
                <field name="kanban_state" />
                <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="oe_kanban_card oe_kanban_global_click">
                            <div class="oe_kanban_content">
                                <h4 class="text-center">
                                    <strong>[<field name="name" />]<![CDATA[&nbsp;]]>
                                        <field name="description" /></strong>
                                </h4>
                                <field name="responsible_user_id" />
                                <br />
                                <field name="category_ids" />
                                <div class="oe_kanban_bottom_right">
                                    <div class="pull-left" groups="base.group_user">
                                        <img
                                            t-att-src="kanban_image('res.users', 'image_128', record.responsible_user_id.raw_value)"
                                            t-att-title="record.responsible_user_id.value"
                                            width="24"
                                            height="24"
                                            t-att-alt="record.responsible_user_id.raw_value"
                                            class="oe_kanban_avatar pull-right"
                                        />
                                        <field name="priority" widget="priority" />
                                    </div>
                                </div>
                            </div>
                            <div class="oe_clear" />
                        </div>
                    </t>
                </templates>
            </kanban>
        </field>
    </record>
    <record id="view_business_requirement_search" model="ir.ui.view">
        <field name="name">business.requirement.search</field>
        <field name="model">business.requirement</field>
        <field name="arch" type="xml">
            <search string="Business Requirement">
                <field
                    name="name"
                    string="Name"
                    filter_domain="['|',
                       ('name', 'ilike', self),
                       ('description', 'ilike', self)]"
                />
                <field name="partner_id" string="Stakeholder" />
                <field name="responsible_user_id" string="Responsible" />
                <field name="origin" string="Source" />
                <filter
                    string="Unread Messages"
                    name="message_needaction"
                    domain="[('message_needaction', '=', True)]"
                />
                <filter
                    string="To be Reviewed"
                    name="to_be_reviewed"
                    domain="[('to_be_reviewed', '!=', False)]"
                />
                <group expand="0" string="Group by">
                    <filter
                        string="Stakeholder"
                        name="stakeholder"
                        context="{'group_by': 'partner_id'}"
                    />
                    <filter
                        string="State"
                        name="state"
                        context="{'group_by': 'state'}"
                    />
                    <filter
                        string="Priority"
                        name="priority"
                        context="{'group_by': 'priority'}"
                    />
                    <filter
                        string="Responsible"
                        name="responsible"
                        context="{'group_by': 'responsible_user_id'}"
                    />
                </group>
            </search>
        </field>
    </record>
    <record id="view_business_requirement_category_form" model="ir.ui.view">
        <field name="name">business.requirement.category.form</field>
        <field name="model">business.requirement.category</field>
        <field name="type">form</field>
        <field name="priority">20</field>
        <field name="arch" type="xml">
            <form string="Business Requirement">
                <sheet>
                    <group>
                        <field name="name" />
                        <field name="parent_id" />
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="view_business_requirement_category_tree" model="ir.ui.view">
        <field name="name">business.requirement.category.form</field>
        <field name="model">business.requirement.category</field>
        <field name="type">tree</field>
        <field name="priority">20</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name" />
                <field name="parent_id" />
            </tree>
        </field>
    </record>
    <record id="act_view_project_br_all" model="ir.actions.act_window">
        <field name="name">Business Requirement</field>
        <field name="res_model">business.requirement</field>
        <field name="view_mode">tree,form</field>
        <field
            name="search_view_id"
            ref="business_requirement.view_business_requirement_search"
        />
        <field name="context">{
            'active_test': False,
        }</field>
        <field name="help" type="html">
            <p>
                Odoo's Business Requirement management allows you to manage the list
                of Business requirement from a Stakeholder for efficient follow up. You can
                track progress, discuss on tasks, attach documents, etc.
            </p>
        </field>
    </record>
    <record model="ir.ui.view" id="view_business_requirement_graph">
        <field name="name">Business requirement</field>
        <field name="model">business.requirement</field>
        <field name="arch" type="xml">
            <graph string="Business Requirement" stacked="True">
                <field name="partner_id" />
            </graph>
        </field>
    </record>
    <record model="ir.ui.view" id="view_business_requirement_pivot">
        <field name="name">Business requirement</field>
        <field name="model">business.requirement</field>
        <field name="arch" type="xml">
            <pivot string="Business Requirement">
            </pivot>
        </field>
    </record>
    <record model="ir.actions.act_window" id="action_business_requirement_tree">
        <field name="name">Business Requirement</field>
        <field name="res_model">business.requirement</field>
        <field name="view_mode">tree,kanban,form,graph,pivot</field>
        <field name="context">{}</field>
    </record>
    <record
        model="ir.actions.act_window"
        id="action_business_requirement_category_tree"
    >
        <field name="name">Categories</field>
        <field name="res_model">business.requirement.category</field>
        <field name="view_mode">tree,form,graph</field>
        <field name="context">{}</field>
    </record>
    <!-- Top menu item -->
    <menuitem
        id="menu_business_root"
        name="Business Requirement"
        groups="business_requirement.group_business_requirement_user"
        sequence="30"
        web_icon="business_requirement,static/description/icon.png"
    />
    <menuitem
        id="menu_business_requirement"
        name="Business Requirement"
        groups="business_requirement.group_business_requirement_user"
        parent="menu_business_root"
        sequence="6"
    />
    <menuitem
        id="menu_business_configuration"
        name="Configuration"
        groups="business_requirement.group_business_requirement_user"
        parent="menu_business_root"
        sequence="10"
    />
    <menuitem
        id="menu_business_requirement1"
        groups="business_requirement.group_business_requirement_user"
        action="action_business_requirement_tree"
        parent="menu_business_requirement"
        sequence="10"
    />
    <menuitem
        id="menu_business_requirement_category"
        groups="business_requirement.group_business_requirement_user"
        action="action_business_requirement_category_tree"
        parent="menu_business_configuration"
        sequence="10"
    />
    <menuitem
        action="product.product_template_action"
        id="menu_product_template_action"
        parent="menu_business_configuration"
        sequence="11"
    />
</odoo>
