From 22211ec6c23e2226f3ab5102a44b2e629da01779 Mon Sep 17 00:00:00 2001 From: Florian Damhaut Date: Wed, 16 Feb 2022 14:10:30 +0000 Subject: [PATCH] [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) --- .../project/static/src/js/right_panel/project_right_panel.js | 3 +++ addons/project/static/src/xml/project_templates.xml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/project/static/src/js/right_panel/project_right_panel.js b/addons/project/static/src/js/right_panel/project_right_panel.js index f5c5158b62f..23b3d53c483 100644 --- a/addons/project/static/src/js/right_panel/project_right_panel.js +++ b/addons/project/static/src/js/right_panel/project_right_panel.js @@ -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', diff --git a/addons/project/static/src/xml/project_templates.xml b/addons/project/static/src/xml/project_templates.xml index 6f3c6426fe0..189dde411aa 100644 --- a/addons/project/static/src/xml/project_templates.xml +++ b/addons/project/static/src/xml/project_templates.xml @@ -27,10 +27,12 @@ -
+
+ +