[FIX] hr_holidays: add employee in the event title of the calendar view
Issue: In the calendar view of Time Off (Approvals / Time Off), we see the "display_name" of the events, but we don't see explicitly the name of the employees associated with the events. Solution: Change the title of the event by adding the employee's name at the beginning. opw-3239972 closes odoo/odoo#117376 X-original-commit: 508f2a9a0adac804f82c24512d85458a888d7b62 Signed-off-by: Kevin Baptiste <kba@odoo.com> Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
This commit is contained in:
@@ -13,6 +13,18 @@ export class TimeOffCalendarModel extends CalendarModel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
normalizeRecord(rawRecord) {
|
||||
let result = super.normalizeRecord(...arguments);
|
||||
if (rawRecord.employee_id) {
|
||||
const employee = rawRecord.employee_id[1];
|
||||
result.title = [employee, result.title].join(' ');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
makeContextDefaults(record) {
|
||||
const { scale } = this.meta;
|
||||
const context = super.makeContextDefaults(record);
|
||||
|
||||
Reference in New Issue
Block a user