[FIX] hr_attendance: invert icons for sign-in/out

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.
This commit is contained in:
stefanorigano
2018-05-22 10:38:05 +02:00
committed by RomainLibert
parent bf65cd83ab
commit 716640bb67
2 changed files with 5 additions and 5 deletions
@@ -47,11 +47,11 @@
<t t-if="!widget.use_pin">
<t t-if="widget.employee_state=='checked_in'">
<h2>Check out</h2>
<a class="fa btn-primary o_hr_attendance_sign_in_out_icon fa-sign-out fa-sign-in"/>
<a class="fa btn-primary o_hr_attendance_sign_in_out_icon fa-sign-out"/>
</t>
<t t-if="widget.employee_state=='checked_out'">
<h2>Check in</h2>
<a class="fa btn-primary o_hr_attendance_sign_in_out_icon fa-sign-out fa-sign-out"/>
<a class="fa btn-primary o_hr_attendance_sign_in_out_icon fa-sign-in"/>
</t>
</t>
<t t-if="widget.use_pin">
@@ -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();