From 716640bb67c1dc030e090746c15d70a4290d990f Mon Sep 17 00:00:00 2001 From: stefanorigano Date: Wed, 2 May 2018 10:24:08 +0200 Subject: [PATCH] [FIX] hr_attendance: invert icons for sign-in/out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set the right employee's possible states. Before the restyling, the main title was always “Welcome!” regardless of the user state (checked_in or checked_out). Using conditional titles has exposed the issue. --- addons/hr_attendance/static/src/xml/attendance.xml | 4 ++-- addons/hr_attendance/static/tests/hr_attendance_tests.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/hr_attendance/static/src/xml/attendance.xml b/addons/hr_attendance/static/src/xml/attendance.xml index 8fa044a0c50..74c9f91a001 100644 --- a/addons/hr_attendance/static/src/xml/attendance.xml +++ b/addons/hr_attendance/static/src/xml/attendance.xml @@ -47,11 +47,11 @@

Check out

-
diff --git a/addons/hr_attendance/static/tests/hr_attendance_tests.js b/addons/hr_attendance/static/tests/hr_attendance_tests.js index 0f09069048c..c8e7c298162 100644 --- a/addons/hr_attendance/static/tests/hr_attendance_tests.js +++ b/addons/hr_attendance/static/tests/hr_attendance_tests.js @@ -15,7 +15,7 @@ QUnit.module('HR Attendance', { attendance_state: { string: 'State', type: 'selection', - selection: [[1, "In"], [2, "Out"]], + selection: [['checked_in', "In"], ['checked_out', "Out"]], default: 1, }, user_id: {string: 'user ID', type: 'integer'}, @@ -23,7 +23,7 @@ QUnit.module('HR Attendance', { records: [{ id: 1, name: "Employee A", - attendance_state: 1, + attendance_state: 'checked_out', user_id: 1, }], }, @@ -45,7 +45,7 @@ QUnit.module('HR Attendance', { }); clientAction.appendTo($target); - assert.strictEqual(clientAction.$('.o_hr_attendance_kiosk_mode h1').text(), 'Welcome Employee A', + assert.strictEqual(clientAction.$('.o_hr_attendance_kiosk_mode h1').text(), 'Employee A', "should have rendered the client action without crashing"); clientAction.destroy();