[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
This commit is contained in:
Goffin Simon
2018-08-30 09:12:34 +02:00
parent 93a586be7c
commit 1962d17c4b
@@ -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));