Files
odoo_source/addons/project/views/project_milestone_views.xml
T
Jensi Chovatiya 8499a1556e [FIX] project: fix the traceback when opening task from milestone
Why traceback occurred:
   When we open the task from the milestone dialog, the milestone dialog does not close,
but the component gets destroyed. And when we manually close the milestone dialog,
it tries to load the props. so the traceback occurred.

In this commit:
When the task is opened from the milestone dialog, the milestone dialog will be closed, and
before loading the pros checked whether the component is mounted or not.

Steps:
- Install the project app
- Active Milestones in  setting
- Open the  Project Updates
- Open any Milestones
- Click on the  task stat button

task-3010877

closes odoo/odoo#105027

X-original-commit: 3f08ff262e2943f870e906e06ec90807f581183c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-06 20:54:56 +01:00

60 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_milestone_view_form" model="ir.ui.view">
<field name="name">project.milestone.view.form</field>
<field name="model">project.milestone</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="%(project.action_view_task_from_milestone)d"
type="action"
class="oe_stat_button"
icon="fa-tasks"
attrs="{'invisible': [('task_count', '=', 0)]}"
context="{'default_project_id': project_id}"
groups="project.group_project_milestone"
close="1"
>
<field name="task_count" string="Tasks" widget="statinfo"/>
</button>
</div>
<group>
<group name="main_details">
<field name="project_id" invisible="1"/>
<field name="name" placeholder="e.g: Product Launch"/>
<field name="deadline"/>
<field name="is_reached"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="project_milestone_view_tree" model="ir.ui.view">
<field name="name">project.milestone.view.tree</field>
<field name="model">project.milestone</field>
<field name="arch" type="xml">
<tree decoration-success="can_be_marked_as_done" decoration-danger="is_deadline_exceeded and not can_be_marked_as_done" decoration-muted="is_reached" editable="bottom" sample="1">
<field name="name"/>
<field name="deadline" optional="show"/>
<field name="is_reached" optional="show"/>
<field name="is_deadline_exceeded" invisible="1"/>
<field name="task_count" invisible="1" />
<field name="can_be_marked_as_done" invisible="1"/>
<button name="action_view_tasks"
type="object"
title="View Tasks"
string="View Tasks"
class="btn btn-link float-end"
attrs="{'invisible': [('task_count', '=', 0)]}"
groups="project.group_project_milestone"
/>
</tree>
</field>
</record>
</odoo>