[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:
@@ -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,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user