From 1962d17c4bda2181cc37516a4482477e18cdcf04 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 29 Aug 2018 15:58:17 +0200 Subject: [PATCH] [FIX] hr_attendance: White screen if employee is not set When the user was not linked to an employee, the first screen of the Attendance app (the check-in/out screen) stayed white. opw:1880582 --- addons/hr_attendance/static/src/js/my_attendances.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hr_attendance/static/src/js/my_attendances.js b/addons/hr_attendance/static/src/js/my_attendances.js index d8f68a3c884..f238e338279 100644 --- a/addons/hr_attendance/static/src/js/my_attendances.js +++ b/addons/hr_attendance/static/src/js/my_attendances.js @@ -25,12 +25,12 @@ var MyAttendances = Widget.extend({ args: [[['user_id', '=', this.getSession().uid]], ['attendance_state', 'name']], }) .then(function (res) { - if (_.isEmpty(res) ) { - self.$('.o_hr_attendance_employee').append(_t("Error : Could not find employee linked to user")); - return; - } self.employee = res[0]; self.$el.html(QWeb.render("HrAttendanceMyMainMenu", {widget: self})); + if (_.isEmpty(res) ) { + return; + } + }); return $.when(def, this._super.apply(this, arguments));