Skip to content

Commit a49fad8

Browse files
ppr-odookmagusiak
authored andcommitted
[FIX] hr_holidays: resolve Missing Record traceback
Steps to reproduce (without demo data): - Install hr_holidays - Go to "My Profile" - Open "Time Off" Issue: Accessing Time Off from a user profile triggers a `Missing Record` error. Cause: The system was passing the user’s active_id to the employee record incorrectly. Fix: Now, when the context's active_model is 'hr.employee', the correct active_id is applied. issue:https://github.com/odoo/odoo/pull/225839/files closes odoo#229606 X-original-commit: abf5829 Signed-off-by: Bertrand Dossogne (bedo) <[email protected]> Signed-off-by: Prakash Prajapati (ppr) <[email protected]>
1 parent ec56125 commit a49fad8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

addons/hr_holidays/static/src/views/calendar/calendar_model.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ export class TimeOffCalendarModel extends CalendarModel {
116116
}
117117

118118
get employeeId() {
119-
return (this.meta.context.employee_id && this.meta.context.employee_id[0]) || this.meta.context.active_id || null;
119+
return (
120+
(this.meta.context.employee_id && this.meta.context.employee_id[0]) ||
121+
(this.meta.context.active_model === "hr.employee" && this.meta.context.active_id) ||
122+
null
123+
);
120124
}
121125

122126
fetchRecords(data) {

0 commit comments

Comments
 (0)