<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="project_view_kanban_inherit_project_forecast" model="ir.ui.view">
        <field name="name">project.kanban.inherit.project.forecast</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.view_project_kanban"/>
        <field name="priority">32</field>
        <field name="arch" type="xml">
            <xpath expr="/kanban" position="inside">
                <field name="allow_forecast"/>
            </xpath>
            <xpath expr="//div[hasclass('o_project_kanban_boxes')]" position="inside">
                <a t-if="record.allow_forecast.raw_value" class="o_project_kanban_box" name="action_view_project_forecast_action_from_project"  type="object">
                    <div>
                        <span class="o_label">Planning</span>
                    </div>
                </a>
            </xpath>
        </field>
        <field name="groups_id" eval="[(4, ref('planning.group_planning_user'))]"/>
    </record>

    <record id="project_project_view_form_simplified_inherit_forecast" model="ir.ui.view">
        <field name="name">project.project.view.form.simplified.inherit.forecast</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.project_project_view_form_simplified"/>
        <field name="priority">32</field>
        <field name="arch" type="xml">
            <field name="user_id" position="after">
                <field name="allow_forecast"/>
            </field>
        </field>
        <field name="groups_id" eval="[(4, ref('planning.group_planning_user'))]"/>
    </record>

    <record id="project_view_form_inherit_project_forecast" model="ir.ui.view">
        <field name="name">project.view.form.inherit.project.forecast</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.edit_project"/>
        <field name="priority">32</field>
        <field name="arch" type="xml">
            <xpath expr="//group[@name='extra_settings']" position="inside">
                <field name="allow_forecast"/>
            </xpath>
            <div name="button_box" position="inside">
                <button class="oe_stat_button" type="object" attrs="{'invisible':[('allow_forecast', '=', False)]}"
                    name="action_view_project_forecast_action_from_project" icon="fa-tasks">
                    <span>Planning</span>
                </button>
            </div>
        </field>
        <field name="groups_id" eval="[(4, ref('planning.group_planning_user'))]"/>
    </record>

</odoo>
