<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Moduon Team S.L.
     License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) -->
<odoo>
    <record id="inherit_crm_lead_view_form_crm_project_task" model="ir.ui.view">
        <field name="name">crm.lead.view.form.inherit.crm.project.task</field>
        <field name="model">crm.lead</field>
        <field name="inherit_id" ref="crm.crm_lead_view_form" />
        <field name="arch" type="xml">
            <xpath expr="header" position="inside">
                <button
                    string="Create Task"
                    name="%(wizard_crm_create_task_action)d"
                    type="action"
                    class="oe_highlight"
                    context="{'default_task_name': name}"
                    attrs="{'invisible': ['|', ('active','=',False), ('task_count', '!=', 0)]}"
                />
            </xpath>
            <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
                <button
                    name="action_tasks"
                    type="object"
                    class="oe_stat_button"
                    icon="fa-tasks"
                >
                    <field string="Task(s)" name="task_count" widget="statinfo" />
                </button>
            </xpath>
        </field>
    </record>

</odoo>
