From da9a994acbd6a5f30b135a9edd26bca349789d72 Mon Sep 17 00:00:00 2001 From: mafo-odoo Date: Fri, 23 Sep 2022 07:14:04 +0000 Subject: [PATCH] [FIX] hr: same view when opeing employee from messaging Steps to reproduce: - set demo to receive notifs in Odoo - go to employees - click "launch plan" for demo user - login as demo user - Click on the link for the activity that is sent in discuss Issue: There is no chatter in the view Explanation: the view of en employee coming from messaging is always hr.employee.public that does not contain the chatter. opw-2990577 closes odoo/odoo#102851 X-original-commit: 93b95317315a1ba70ce0331c63321ab8eaa487d3 Signed-off-by: Fockedey Martin (mafo) Signed-off-by: Kevin Baptiste --- addons/hr/static/src/models/employee.js | 4 ++-- addons/hr/static/src/models/messaging.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr/static/src/models/employee.js b/addons/hr/static/src/models/employee.js index 0b26e7b5b60..bb917e3124f 100644 --- a/addons/hr/static/src/models/employee.js +++ b/addons/hr/static/src/models/employee.js @@ -141,10 +141,10 @@ registerModel({ /** * Opens the most appropriate view that is a profile for this employee. */ - async openProfile() { + async openProfile(model = 'hr.employee.public') { return this.messaging.openDocument({ id: this.id, - model: 'hr.employee.public', + model: model, }); }, }, diff --git a/addons/hr/static/src/models/messaging.js b/addons/hr/static/src/models/messaging.js index 6c35755310a..5f2338e1de1 100644 --- a/addons/hr/static/src/models/messaging.js +++ b/addons/hr/static/src/models/messaging.js @@ -25,7 +25,7 @@ registerPatch({ async openProfile({ id, model }) { if (model === 'hr.employee' || model === 'hr.employee.public') { const employee = this.messaging.models['Employee'].insert({ id }); - return employee.openProfile(); + return employee.openProfile(model); } return this._super(...arguments); },