[FIX]project: traceback on project update notif

Step to reproduce:
- Schedule activity on a project update
- Access the activity

Current Behaviour:
- On Project.update, we try to compute the info related to the project_update's project
due to the project update view showing information about the project.
In case of notification, we can show multiple project and thus no project_id can be
provided.
- Traceback

Behaviour after the PR:
- If there is no set project_id when opening the project update kanban view
We do not show the RightPanel related to the project and do not compute

related PR in enterprise odoo/enterprise#24427

opw-2755473

closes odoo/odoo#85060

X-original-commit: 9e30888195db0d01f06dffa9d59ae652fe6de5f0
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
Florian Damhaut
2022-02-21 19:22:04 +00:00
parent dcef7d1f9c
commit 22211ec6c2
2 changed files with 6 additions and 1 deletions
@@ -28,6 +28,9 @@ export default class ProjectRightPanel extends Component {
}
async _loadQwebContext() {
if (!this.project_id){ // If this is called from notif, multiples updates but no specific project
return {};
}
const data = await this.rpc({
model: 'project.project',
method: 'get_panel_data',
@@ -27,10 +27,12 @@
</div>
<t t-name="project.ProjectRightPanel" owl="1">
<div class="o_rightpanel">
<div t-if="project_id" class="o_rightpanel">
<t t-call="project.StatButtonsSection"/>
<t t-call="project.MilestoneSection"/>
</div>
<!-- If this is called from notif, multiples updates but no specific project -->
<div t-else=""/>
</t>
<t t-name="project.StatButtonsSection" owl="1">