[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) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
mafo-odoo
2022-10-10 13:00:51 +02:00
parent 25b5ab1bc3
commit da9a994acb
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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,
});
},
},
+1 -1
View File
@@ -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);
},