diff --git a/addons/hr_attendance/static/src/js/kiosk_mode.js b/addons/hr_attendance/static/src/js/kiosk_mode.js index 6eb065739f6..d561f380c45 100644 --- a/addons/hr_attendance/static/src/js/kiosk_mode.js +++ b/addons/hr_attendance/static/src/js/kiosk_mode.js @@ -16,10 +16,10 @@ var KioskMode = Widget.extend({ var self = this; core.bus.on('barcode_scanned', this, this._onBarcodeScanned); self.session = Session; - this._rpc({ + var def = this._rpc({ model: 'res.company', method: 'search_read', - args: [[['id', '=', self.session.company_id]], ['name']], + args: [[['id', '=', this.session.company_id]], ['name']], }) .then(function (companies){ self.company_name = companies[0].name; @@ -27,7 +27,7 @@ var KioskMode = Widget.extend({ self.$el.html(QWeb.render("HrAttendanceKioskMode", {widget: self})); self.start_clock(); }); - return self._super.apply(this, arguments); + return $.when(def, this._super.apply(this, arguments)); }, _onBarcodeScanned: function(barcode) { diff --git a/addons/hr_attendance/static/src/js/my_attendances.js b/addons/hr_attendance/static/src/js/my_attendances.js index a1e11c05f40..d8f68a3c884 100644 --- a/addons/hr_attendance/static/src/js/my_attendances.js +++ b/addons/hr_attendance/static/src/js/my_attendances.js @@ -19,10 +19,10 @@ var MyAttendances = Widget.extend({ start: function () { var self = this; - this._rpc({ + var def = this._rpc({ model: 'hr.employee', method: 'search_read', - args: [[['user_id', '=', self.getSession().uid]], ['attendance_state', 'name']], + args: [[['user_id', '=', this.getSession().uid]], ['attendance_state', 'name']], }) .then(function (res) { if (_.isEmpty(res) ) { @@ -33,7 +33,7 @@ var MyAttendances = Widget.extend({ self.$el.html(QWeb.render("HrAttendanceMyMainMenu", {widget: self})); }); - return this._super.apply(this, arguments); + return $.when(def, this._super.apply(this, arguments)); }, update_attendance: function () {