<?xml version="1.0"?>
<form string="Task" class="o_form_project_tasks" js_class="project_task_form">
                    <field name="allow_subtasks" invisible="1"/>
                    <field name="is_closed" invisible="1"/>
                    <field name="allow_recurring_tasks" invisible="1"/>
                    <field name="repeat_show_dow" invisible="1"/>
                    <field name="repeat_show_day" invisible="1"/>
                    <field name="repeat_show_week" invisible="1"/>
                    <field name="repeat_show_month" invisible="1"/>
                    <field name="recurrence_id" invisible="1"/>
                    <field name="allow_task_dependencies" invisible="1"/>
                    <field name="rating_last_value" invisible="1"/>
                    <field name="rating_count" invisible="1"/>
                    <field name="allow_milestones" invisible="1"/>
                    <field name="parent_id" invisible="1"/>
                    <field name="company_id" invisible="1"/>
                    <header>
                        <button name="action_assign_to_me" string="Assign to Me" type="object" attrs="{'invisible': &quot;['|', ('user_ids', 'in', uid), ('user_ids', '=', [])]&quot;}" data-hotkey="q"/>
                        <button name="action_assign_to_me" string="Assign to Me" type="object" class="oe_highlight" attrs="{'invisible' : &quot;['|', ('user_ids', 'in', uid), ('user_ids', '!=', [])]&quot;}" data-hotkey="q"/>
                        <field name="stage_id" widget="statusbar" options="{'clickable': '1', 'fold_field': 'fold'}" attrs="{'invisible': [('project_id', '=', False), ('stage_id', '=', False)]}"/>
                        <field name="personal_stage_type_id" widget="statusbar" options="{'clickable': '1', 'fold_field': 'fold'}" attrs="{'invisible': [('project_id', '!=', False)]}" domain="[('user_id', '=', uid)]"/>
                    </header>
                    <div class="alert alert-info oe_edit_only mb-0" role="status" attrs="{'invisible': ['|', ('recurring_task', '=', False), ('recurrence_id', '=', False)]}" groups="project.group_project_recurring_tasks">
                        <p>Edit recurring task</p>
                        <field name="recurrence_update" widget="radio"/>
                    </div>
                    <sheet string="Task">
                    <div class="oe_button_box" name="button_box">
                        <!-- Dummy tag for organizing buttons, using position='replace' when inheriting -->
                        <span id="button_products" invisible="1"/>
                        <span id="button_worksheet" invisible="1"/>
                        <!-- Dummy tag used to organize buttons, englobing the 3 buttons modifies the width of the button -->
                        <span id="start_rating_buttons" invisible="1"/>
                        <field name="rating_avg" invisible="1"/>
                        <field name="rating_active" invisible="1"/>
                        <button name="action_open_ratings" type="object" attrs="{'invisible': ['|', ('rating_count', '=', 0), ('rating_active', '=', False)]}" class="oe_stat_button" groups="project.group_project_rating">
                            <i class="fa fa-fw o_button_icon fa-smile-o text-success" attrs="{'invisible': [('rating_avg', '&lt;', 3.66)]}" title="Satisfied"/>
                            <i class="fa fa-fw o_button_icon fa-meh-o text-warning" attrs="{'invisible': ['|', ('rating_avg', '&lt;', 2.33), ('rating_avg', '&gt;=', 3.66)]}" title="Okay"/>
                            <i class="fa fa-fw o_button_icon fa-frown-o text-danger" attrs="{'invisible': [('rating_avg', '&gt;=', 2.33)]}" title="Dissatisfied"/>
                            <div class="o_field_widget o_stat_info">
                                <span class="o_stat_value"><field name="rating_avg_text" nolabel="1"/></span>
                                <span class="o_stat_text">Last Rating</span>
                            </div>
                        </button>
                        <!-- Dummy tag used to organize buttons -->
                        <span id="end_rating_buttons" invisible="1"/>
                        <button name="action_open_parent_task" type="object" class="oe_stat_button" icon="fa-tasks" string="Parent Task" attrs="{'invisible': ['|', ('allow_subtasks', '=', False), ('parent_id', '=', False)]}" groups="project.group_subtask_project"/>
                        <button name="action_recurring_tasks" type="object" attrs="{'invisible': [('recurrence_id', '=', False)]}" class="oe_stat_button" icon="fa-repeat" groups="project.group_project_recurring_tasks">
                            <div class="o_field_widget o_stat_info">
                                <span class="o_stat_value">
                                    <field name="recurring_count" widget="statinfo" nolabel="1"/>
                                    Tasks
                                </span>
                                <span class="o_stat_text">in Recurrence</span>
                            </div>
                        </button>
                        <button name="392" type="action" class="oe_stat_button" icon="fa-tasks" attrs="{'invisible' : ['|', '|', ('allow_subtasks', '=', False), ('id', '=', False), ('subtask_count', '=', 0)]}" context="{'default_user_ids': user_ids}">
                            <div class="o_field_widget o_stat_info">
                                <span class="o_stat_value">
                                    <field name="subtask_count" widget="statinfo" nolabel="1"/>
                                </span>
                                <span class="o_stat_text">Sub-tasks</span>
                            </div>
                        </button>
                        <button name="action_dependent_tasks" type="object" attrs="{'invisible': [('dependent_tasks_count', '=', 0)]}" class="oe_stat_button" icon="fa-tasks" groups="project.group_project_task_dependencies">
                            <div class="o_field_widget o_stat_info">
                                <span class="o_stat_text">Blocking</span>
                                <span class="o_stat_value ">
                                    <field name="dependent_tasks_count" widget="statinfo" nolabel="1"/>
                                    Tasks
                                </span>
                            </div>
                        </button>
                        <!-- Dummy tag used to organize buttons -->
                        <span id="end_button_box" invisible="1"/>
                    </div>
                    <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                    <div class="oe_title pe-0">
                        <h1 class="d-flex justify-content-between align-items-center">
                            <div class="d-flex w-100">
                                <field name="priority" widget="priority" class="me-3"/>
                                <field name="name" class="o_task_name text-truncate w-100 w-md-75 pe-2" placeholder="Task Title..."/>
                            </div>
                            <field name="kanban_state" widget="state_selection" class=""/>
                        </h1>
                    </div>
                    <group>
                        <group>
                            <field name="project_id" placeholder="Private" domain="[('active', '=', True), ('company_id', '=', company_id)]" attrs="{'invisible': [('parent_id', '!=', False)]}" widget="project_private_task"/>
                            <field name="display_project_id" string="Project" attrs="{'invisible': [('parent_id', '=', False)]}" domain="[('active', '=', True), ('company_id', '=', company_id)]"/>
                            <field name="milestone_id" placeholder="e.g. Product Launch" context="{'default_project_id': project_id if not parent_id or not display_project_id else display_project_id}" attrs="{'invisible': ['|', ('project_id', '=', False), ('allow_milestones', '=', False)]}"/>
                            <field name="user_ids" class="o_task_user_field" options="{'no_open': True, 'no_quick_create': True}" widget="many2many_avatar_user" domain="[('share', '=', False), ('active', '=', True)]"/>
                        </group>
                        <group>
                            <field name="active" invisible="1"/>
                            <field name="partner_id" widget="res_partner_many2one" class="o_task_customer_field"/>
                            <field name="partner_phone" widget="phone" attrs="{'invisible': True}"/>
                            <field name="date_deadline" attrs="{'invisible': [('is_closed', '=', True)]}"/>
                            <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" context="{'project_id': project_id}"/>
                            <field name="legend_blocked" invisible="1"/>
                            <field name="legend_normal" invisible="1"/>
                            <field name="legend_done" invisible="1"/>
                        </group>
                    </group>
                    <field attrs="{'invisible': [('project_id', '=', False)]}" name="task_properties" nolabel="1" columns="2" hideKanbanOption="1"/>
                    <notebook>
                        <page name="description_page" string="Description">
                            <field name="description" type="html" options="{'collaborative': true, 'resizable': false}" placeholder="Task description..."/>
                        </page>
                        <page name="sub_tasks_page" string="Sub-tasks" attrs="{'invisible': [('allow_subtasks', '=', False)]}">
                            <field name="child_ids" context="{'search_view_ref' : 'project.view_task_search_form_extended', 'default_project_id': project_id if not parent_id or not display_project_id else display_project_id, 'default_user_ids': user_ids, 'default_parent_id': id,                                     'default_partner_id': partner_id, 'default_milestone_id': allow_milestones and milestone_id, 'search_default_display_project_id': project_id }" widget="many2many" domain="['!', ('id', 'parent_of', id)]">
                                <tree editable="bottom" decoration-muted="is_closed == True">
                                    <field name="legend_normal" invisible="1"/>
                                    <field name="legend_done" invisible="1"/>
                                    <field name="legend_blocked" invisible="1"/>
                                    <field name="project_id" invisible="1"/>
                                    <field name="is_closed" invisible="1"/>
                                    <field name="allow_milestones" invisible="1"/>
                                    <field name="sequence" widget="handle"/>
                                    <field name="priority" widget="priority" optional="show" nolabel="1" options="{'autosave': False}"/>
                                    <field name="id" optional="hide"/>
                                    <field name="child_text" invisible="1"/>
                                    <field name="allow_subtasks" invisible="1"/>
                                    <field name="name" widget="name_with_subtask_count"/>
                                    <field name="display_project_id" string="Project" optional="hide" options="{'no_open': 1}"/>
                                    <field name="milestone_id" optional="hide" context="{'default_project_id': display_project_id or project_id}" attrs="{'invisible': [('allow_milestones', '=', False)], 'column_invisible': [('parent.allow_milestones', '=', False)]}"/>
                                    <field name="partner_id" optional="hide"/>
                                    <field name="user_ids" widget="many2many_avatar_user" optional="show" domain="[('share', '=', False), ('active', '=', True)]"/>
                                    <field name="company_id" groups="base.group_multi_company" optional="hide"/>
                                    <field name="company_id" invisible="1"/>
                                    <field name="activity_ids" string="Next Activity" widget="list_activity" optional="hide"/>
                                    <field name="date_deadline" attrs="{'invisible': [('is_closed', '=', True)]}" optional="show"/>
                                    <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="hide"/>
                                    <field name="rating_last_text" string="Rating" decoration-danger="rating_last_text == 'ko'" decoration-warning="rating_last_text == 'ok'" decoration-success="rating_last_text == 'top'" attrs="{'invisible': [('rating_last_text', '=', 'none')]}" class="fw-bold" widget="badge" optional="hide"/>
                                    <field name="kanban_state" widget="state_selection" optional="show" options="{'hide_label': True, 'autosave': False}" nolabel="1"/>
                                    <field name="stage_id" optional="show" context="{'default_project_id': project_id}"/>
                                    <button name="action_open_task" type="object" title="View Task" string="View Task" class="btn btn-link float-end"/>
                                </tree>
                            </field>
                        </page>
                        <page name="task_dependencies" string="Blocked By" attrs="{'invisible': [('allow_task_dependencies', '=', False)]}" groups="project.group_project_task_dependencies">
                            <field name="depend_on_ids" nolabel="1" context="{'default_project_id' : project_id}">
                                <tree editable="bottom" decoration-muted="is_closed == True">
                                    <field name="allow_milestones" invisible="1"/>
                                    <field name="parent_id" invisible="1"/>
                                    <field name="display_project_id" invisible="1"/>
                                    <field name="is_closed" invisible="1"/>
                                    <field name="priority" widget="priority" optional="show" nolabel="1" options="{'autosave': False}"/>
                                    <field name="child_text" invisible="1"/>
                                    <field name="allow_subtasks" invisible="1"/>
                                    <field name="name" widget="name_with_subtask_count"/>
                                    <field name="id" optional="hide"/>
                                    <field name="project_id" optional="hide" options="{'no_open': 1}"/>
                                    <field name="milestone_id" optional="hide" context="{'default_project_id': project_id if not parent_id or not display_project_id else display_project_id}" attrs="{'invisible': [('allow_milestones', '=', False)], 'column_invisible': [('parent.allow_milestones', '=', False)]}"/>
                                    <field name="partner_id" optional="hide"/>
                                    <field name="parent_id" optional="hide" attrs="{'invisible': [('allow_subtasks', '=', False)]}" groups="base.group_no_one"/>
                                    <field name="user_ids" widget="many2many_avatar_user" optional="show" domain="[('share', '=', False), ('active', '=', True)]"/>
                                    <field name="company_id" optional="hide" groups="base.group_multi_company"/>
                                    <field name="company_id" invisible="1"/>
                                    <field name="activity_ids" string="Next Activity" widget="list_activity" optional="hide"/>
                                    <field name="date_deadline" attrs="{'invisible': [('is_closed', '=', True)]}" optional="show"/>
                                    <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="hide"/>
                                    <field name="rating_last_text" string="Rating" decoration-danger="rating_last_text == 'ko'" decoration-warning="rating_last_text == 'ok'" decoration-success="rating_last_text == 'top'" attrs="{'invisible': [('rating_last_text', '=', 'none')]}" class="fw-bold" widget="badge" optional="hide"/>
                                    <field name="legend_normal" invisible="1"/>
                                    <field name="legend_done" invisible="1"/>
                                    <field name="legend_blocked" invisible="1"/>
                                    <field name="kanban_state" widget="state_selection" optional="show" options="{'hide_label': True, 'autosave': False}" nolabel="1"/>
                                    <field name="stage_id" optional="show"/>
                                    <button class="oe_link float-end" string="View Task" name="action_open_task" type="object"/>
                                </tree>
                            </field>
                        </page>
                        <page name="recurrence" string="Recurrent" groups="project.group_project_recurring_tasks">
                            <label for="recurring_task"/>
                            <field name="recurring_task" class="ms-5" attrs="{'invisible': ['|', ('allow_recurring_tasks', '=', False), ('active', '=', False)]}"/>
                            <group attrs="{'invisible': [('recurring_task', '=', False)]}">
                                <group>
                                    <label for="repeat_interval"/>
                                    <div class="o_col">
                                        <div class="o_row">
                                            <field name="repeat_interval" attrs="{'required': [('recurring_task', '=', True)]}"/>
                                            <field name="repeat_unit" attrs="{'required': [('recurring_task', '=', True)]}"/>
                                        </div>
                                        <widget name="week_days" attrs="{'invisible': [('repeat_show_dow', '=', False)]}" groups="project.group_project_user"/>
                                    </div>

                                    <label for="repeat_on_month" string="Repeat On" attrs="{'invisible': [('repeat_unit', 'not in', ('month', 'year'))]}"/>
                                    <div class="o_row" attrs="{'invisible': [('repeat_unit', 'not in', ('month', 'year'))]}">
                                        <field name="repeat_on_month" attrs="{'invisible': [('repeat_unit', '!=', 'month')], 'required': [('repeat_unit', '=', 'month')]}"/>
                                        <field name="repeat_on_year" attrs="{'invisible': [('repeat_unit', '!=', 'year')], 'required': [('repeat_unit', '=', 'year')]}"/>

                                        <field name="repeat_day" attrs="{'invisible': [('repeat_show_day', '=', False)], 'required': [('repeat_show_day', '=', True)]}"/>
                                        <field name="repeat_week" attrs="{'invisible': [('repeat_show_week', '=', False)], 'required': [('repeat_show_week', '=', True)]}"/>
                                        <field name="repeat_weekday" attrs="{'invisible': [('repeat_show_week', '=', False)], 'required': [('repeat_show_week', '=', True)]}"/>
                                        <span attrs="{'invisible': ['|', ('repeat_show_week', '=', False), ('repeat_show_month', '=', False)]}">of</span>
                                        <field name="repeat_month" attrs="{'invisible': [('repeat_show_month', '=', False)], 'required': [('repeat_show_month', '=', True)]}"/>
                                    </div>
                                    <!-- Those fields are added to trigger the compute method for the recurrence feature. -->
                                    <field name="mon" invisible="1"/>
                                    <field name="tue" invisible="1"/>
                                    <field name="wed" invisible="1"/>
                                    <field name="thu" invisible="1"/>
                                    <field name="fri" invisible="1"/>
                                    <field name="sat" invisible="1"/>
                                    <field name="sun" invisible="1"/>

                                    <label for="repeat_type"/>
                                    <div class="o_row">
                                        <field name="repeat_type" attrs="{'required': [('recurring_task', '=', True)]}"/>
                                        <field name="repeat_until" attrs="{'invisible': [('repeat_type', '!=', 'until')], 'required': [('repeat_type', '=', 'until')]}"/>
                                        <field name="repeat_number" attrs="{'invisible': [('repeat_type', '!=', 'after')], 'required': [('repeat_type', '=', 'after')]}"/>
                                    </div>
                                </group>
                            </group>
                            <group attrs="{'invisible': ['|', ('recurring_task', '=', False), ('recurrence_message', '=', False)]}" groups="project.group_project_user">
                                <div class="alert alert-success o_form_project_recurrence_message" role="status" colspan="2">
                                    <field name="recurrence_message" widget="html" class="mb-0"/>
                                </div>
                            </group>
                        </page>
                        <page name="extra_info" string="Extra Info" groups="base.group_no_one">
                            <group>
                                <group>
                                    <field name="is_analytic_account_id_changed" invisible="1"/>
                                    <field name="parent_id" attrs="{'invisible': [('allow_subtasks', '=', False)]}" groups="base.group_no_one"/>
                                    <field name="analytic_account_id" groups="analytic.group_analytic_accounting" context="{'default_partner_id': partner_id}"/>
                                    <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
                                    <field name="sequence" groups="base.group_no_one"/>
                                    <field name="email_from" invisible="1"/>
                                    <field name="email_cc" groups="base.group_no_one"/>
                                    <field name="displayed_image_id" groups="base.group_no_one" options="{'no_create': True}"/>
                                </group>
                                <group>
                                    <field name="date_assign" groups="base.group_no_one"/>
                                    <field name="date_last_stage_update" groups="base.group_no_one"/>
                                </group>
                                <group string="Working Time to Assign" attrs="{'invisible': [('working_hours_open', '=', 0.0)]}">
                                    <field name="working_hours_open" widget="float_time" string="Hours"/>
                                    <field name="working_days_open" string="Days"/>
                                </group>
                                <group string="Working Time to Close" attrs="{'invisible': [('working_hours_close', '=', 0.0)]}">
                                    <field name="working_hours_close" widget="float_time" string="Hours"/>
                                    <field name="working_days_close" string="Days"/>
                                </group>
                            </group>
                        </page>
                    </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" options="{'post_refresh':True}" groups="base.group_user"/>
                        <field name="activity_ids"/>
                        <field name="message_ids"/>
                    </div>
                </form>
            