No notifications should be received whilst in Kiosk Mode.
closesodoo/odoo#81694
Taskid: 2704624
X-original-commit: 202a5a075b90a564d37c68d2f21f9c1edd8a7caf
Signed-off-by: Kevin Baptiste <kba@odoo.com>
A wrong company was used in the Kiosk mode, preventing users to check in
/ out.
closesodoo/odoo#80035
Taskid: 2691031
X-original-commit: ed3003c9d8ce11a8f59966d28371883df5eb9c36
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Improves on the display when closing an attendance to display today's
overtime aswell as the total overtime the employee has.
Also small cleanup, remove unused variable.
TaskId-2655689
closesodoo/odoo#77841
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The context was missing from multiple RPC calls in the attendance's
kiosk modes resulting in the wrong employee being fetched for the
attendnace creation, all RPC calls related to attendances are now given
the context explicitely.
TaskId-2660772
closesodoo/odoo#77750
X-original-commit: 26c5e25481d93e5f9db6c4becefc4f17d3974eaf
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
This commit adds a new model `hr.attendance.overtime`.
When an employee checks out, an overtime entry will be created when:
- the option is enabled on the company;
- the employee worked more or less than the number of hours they
were supposed to work that day.
TaskID: 1904850
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.
Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient
Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.
closesodoo/odoo#69819
Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The 'addMockEnvironment' test utils allows to patch a lot of stuff,
including the session, for the sake of a test. However, it assumes
that it is only called once inside a test (or at least, that its
cleanUp function is always called before it is called again).
In this hr_attendance test, it isn't the case. 2 client actions are
instantiated, and addMockEnvironment is called for each of them,
in particular to patch the session.
The first call stores the current session (the real one), to restore
it in its cleanup (1). The second call stores the current session
(the mocked one, produced by the first call), to restore it in its
cleanup (2). The cleanup functions are called in order, so (1)
before (2), meaning that at the end, we end up with the session
being the mocked one of the first call to addMockEnvironment.
The very short term solution is to ensure, in this test, that the
cleanup functions are called in the correct order. For the long
term, we are working on a robust mechanism to correctly clean up
everything after a test.
Issue spotted in the assets revamp task, which mixed a bit the
order of the tests.
closesodoo/odoo#67891
X-original-commit: bb43c74dd10c76b8a80d5749106b86432b13909e
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently, when we open kiosk mode in attendance then the barcode
image is broken in community due to wrong img path.
So in this commit, Fix the barcode image as path to display
barcode image properly.
closesodoo/odoo#56868
Taskid: 2327526
X-original-commit: 4bfe8136f7cec853c1339c6d27754b8f1bc1c72d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Make the employee presence icons more descriptive.
Allow to quickly filter the Presence Reports based on the user status.
closesodoo/odoo#54527
Taskid: 2246447
Related: odoo/upgrade#1488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
After #56a8c9e4311d24c33b7ad08b8230e4be345a85b8 we check access rights in function fields_view_get,
so a user with only 'Kiosk Attendance' right can't see public
employee profile.
After this commit:
In attendance application, we always show public employee profile
as it not usefull to show more information in this application.
closesodoo/odoo#55341
Taskid: 2298803
X-original-commit: 1fbb8f1ebcb805317b93e0b4ea363aaec8e3e36e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The time to display the check in/check out time was hardcoded to
HH:mm:ss while other locales may use different formats.
Use the appropriate time utils to retrieve the right format that uses
the time format from the res.lang record.
Fixesodoo/odoo#50527closesodoo/odoo#54079
X-original-commit: 47707e1b099195487fd3d3e0ae012e4aed5a9bc5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit adapts tests following recent changes on the helpers.
The main change is that addMockEnvironment (and all functions using
it) are now async, as they need to wait for services to be started.
The user for the kiosk mode must have access to personal information of
the employees. To avoid easily leaking information, prevent grouping.
Fixes#34231
opw-2079330
closesodoo/odoo#38120
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
hr:
-rename btn 'generate badge ID' to 'generate'
-When the badge ID is set, replace the button Generate by "Print Badge"
hr_attendance:
-Rename menu 'Manage Attendances' to "Manager"
-Add a column "Work Hours" to attendee tree view
-Add a <br> after "Welcome to"
-add class text-muted on "or"
-remove class "text-muted" on "scan your badge
-Rename the primary btn into "Identify Manually"
Task-2040884
Closes: #35473
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
what was previously the big size)
+ add new intermediate format:
image_512
PR: #34925
1/ web: adapt formatDate to handle NaN values
DashboardRenderer might return NaN for `Date` or `DateTime` fields if
their original value is null or incorrect.
2/ hr: add job_title in demo data
3/ hr_recruitment: link employee in the chatter for new recruits
4/ hr: remove employee documents in the model
5/ hr_attendance: improve resiliency of relative_time
6/ hr: display manager on res_users
7/ hr: change Address Book to Employee Directory
TaskID: 2009111
closesodoo/odoo#34180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
======
When an empoyee wants to check out, he does not know the number of hours he worked today.
Specification
==========
In the check out view, display how many hours the employee was checked in today.
closesodoo/odoo#33974
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
- Have a slow network
- Click multiple times on the 'Check-in' button
Multiple attendances are created.
The view refactoring introduced in 9de1bc0eef changed the
element to a `<a>` tag, on which the `disabled` attribute has no effect.
We introduce a `debounce` instead.
opw-1941647
closesodoo/odoo#31178
When running in kiosk mode, it is necessary to refresh the interface
once a week since the session is garbage collected.
The garbage collection method `session_gc` relies on the last
modification time of the session file. However, the session file is only
saved when the field key `should_save` of the session request is `True`.
This happens when the session is `modified`, i.e. an item on the cookie
is set.
In practice, the session is saved at each reload of the page. Regular
RPC calls, such as the one used in commit 6e1b660f9c, do not
trigger a modification of the session file. Therefore, we create a new
route which explicitly sets the session as `modified`, which ultimately
triggers a `save` in `get_response`.
opw-1917254
closesodoo/odoo#29919
to ControlPanel/Search view refactoring.
The ControlPanel being now inside the DOM of client actions, those
existing widgets needed to be adapted (in the way they define if
and how they want a ControlPanel, and in the way the manipulate
their DOM as it slightly changed). Tests needed to be adapted as
well.
Part of task 1893568
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.
All the helpers are exposed though testUtils.js.
There are 2 kinds of helpers:
1. Assertions
-------------
* assert.containsNone, containsN, containsOnce check that the DOM
(or a specific part of the DOM) contains a `selector`. It
generates a correct error message automatically.
ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
-> assert.containsOnce(form, '.o_form_editable');
* assert.isVisible, isNotVisible check that the DOM has an element
visible or not. They also check that the element is actually in
the DOM (before most tests didn't verify this).
* assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
properties of a DOM element, and also validate that it is
applied on a single existing DOM element (before most tests
didn't verify this).
ex: assert.notOk(form.$('button').hasClass('btn-primary'));
-> assert.doesNotHaveClass(form.$('button'), 'btn-primary');
2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.
Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
ex: form.$('button').click();
-> testUtils.dom.click(form.$('button'));
New Form utilities: (testUtils.form.*)
clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
the control panel buttons of the form.
`reload` reloads the form data.
New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).
New fields utils: (testUtils.fields.*)
* editInput, editSelect: allow to change the value of a field,
using a selector to identify it. They validate that the input
exists and trigger the change event automatically.
* editAndTrigger: allow to modify a field and trigger specific
events after the value change
* many2one (testUtils.fields.many2one.*)
clickOpenDropdown, clickHighlightedItem, clickItem,
searchAndClickItem: use a field name instead of a selector and
do all the complex mechanism to open, filter and highlight
many2one fields.
Joint work with aab, dam, ged, mge, svs and vsc.
- Open the Attendance kiosk mode
- Scan an incorrect barcode
It's not possible to scan any barcode anymore.
If the barcode is incorrect, we need to add back the event listener.
Moreover, the RPC introduced with bbc7e9586d is not necessary if
we retrieve the barcode thanks to the existing RPC call.
opw-1878632
opw-1888402
closesodoo/odoo#28354
The main goal here is to avoid using a global variable.
The greeting message _onBarcodeScanned bus can be stoped right after
the barcode_scanned as every time a barcode is scanned, it creates
a new instance of the greeting message.
Some other JS guidelines are also applied here.
Special thanks to Martin Geubelle (@mge-odoo) for helping me on this.
[TEST] hr_attendance : add test for multiple quick scan in kiosk mode
Glorious thanks to @RomainLibert who fu**s off his brain to help me
understand what was really going on and how to simulate the
functional behaviour of Greeting Message kiosk stuff.
Task ID 1878251
Closes PR #27127
Since the the commit that added the barcode listener in the
greeting_message view (aaff7d5d51),
if someone check in and check out and check in again quickly,
during the 5 seconds before the welcome view come back,
multiple rpc where made to call attendance_scan method,
resulting to create inconsistent records in the db.
Typically, a check in records could have been create before
the confirmation of last check out.
Here, we avoid scanning twice the same barcode, between welcome
and greeting message view but also inside the greeting message view
itself.
Employees are now able to check in or check out quickly. Obviously,
if the same employee wants to check in and check out within 5 sec,
he will need to wait the 5 seconds.
Task ID 1878251
Closes PR #27101
Odoo used to declare two main colors: primary and optional (which are
purple and turquoise in enterprise). Those were respectively assigned
to the 'primary' bootstrap variable and the 'btn-primary' bootstrap
variable.
BS4, however, does not allow to have a different primary color for
buttons. Instead, the 'primary' color is used for all 'primary' related
components and utility classes, same as for all other colors. So, if we
want to keep our enterprise buttons green, our 'optional' colors had to
become our 'primary' color. The old odoo primary is then renamed to the
'odoo' color.
The palette of grays is now larger by default and is numbered from 100 to
900 alongside the $black and $white variables. The equivalence for older
variables and the way we used them is:
$gray-darker -> gray 900 (unused before)
$gray-dark -> gray 900
$gray -> gray 700
$gray-light -> gray 600
$gray-lighter-darker -> gray 400 (the old variable was created by us)
$gray-lighter-dark -> gray 300 (the old variable was created by us)
$gray-lighter -> gray 200
Fortunately, the 'lighter' variations we created fit well in the default
BS4 system ! Unfortunately, our $gray-lighter which carried the same
function as $gray-200 (see above) is very close to the new default
$gray-100 and quite distant from the new $gray-200. This will be handled
in the next commit.
The system completely changed. I also had to adapt classes to new
screen breakpoints.
hidden/hide -> d-none
show -> d-block
hidden-xs -> d-none d-md-(block/inline/...)
hidden-sm -> d-md-none d-lg-(block/inline/...)
hidden-md -> d-lg-none d-xl-(block/inline/...)
hidden-lg -> d-xl-none
visible-xs-* -> d-* d-md-none
visible-sm-* -> d-none d-md-* d-lg-none
visible-md-* -> d-none d-lg-* d-xl-none
visible-lg-* -> d-none d-xl-*
hidden-print -> d-print-none
visible-print-* -> d-none d-print-*
...
and all possible combination of those had to be handled too.
media queries that target a specific screen size handled by bootstrap
have now a more convenient way to be defined:
```
@media (min-width: $screen-sm-min) { ... }
->
@include media-breakpoint-up(sm) { ... }
```
```
@media (max-width: $screen-sm-max) { ... }
->
@include media-breakpoint-down(sm) { ... }
```
```
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { ... }
->
@include media-breakpoint-only(sm) { ... }
```
```
@media (min-width: $screen-sm-min) and (max-width: $screen-md-max) { ... }
->
@include media-breakpoint-between(sm, md) { ... }
```
Also, bootstrap has changed the values for its default screen sizes:
------------------
| BS3 | BS4 |
------------------
0 | XS | XS | -> Portrait Mobile
576 | / | SM | -> Landscape Mobile
768 | SM | MD | -> Portrait Tablet
992 | MD | LG | -> Landscape Tablet / Small Desktop
1200 | LG | XL | -> Desktop
------------------
While it is possible to configure BS variables to behave as BS3, we took
the decision to keep the BS4 variables untouched. BS4 system seems
indeed better and having the purest bootstrap possible is better for
Odoo to be used as a framework.
BS4 do not provide vendor prefixes scss mixins anymore as it is meant
to be used with the 'autoprefixer' library. As we only support the last
version of every major browsers in Odoo, we took the decision to not
use the library as it was also complex to integrate in Odoo. We decided
to do the library's work by hand if it ever become necessary.
When user is not linked to any employee and get try to check in/out then user
gets white screen. Instead correctly displays a warning message telling
the user should have an employee.
Screeshot: https://drive.google.com/file/d/1cX1NtCcELeTYgr0kK5cW4i5etyHtezAV/view
This commit is related to task ID 1841522. Closes PR #25230.
Description of the issue/feature this PR addresses:
Accessibility improvements forbids the use of the syntax
`<i class="fa fa-check"/> Some text`
to create a labelled icon. But, by this, some fonts are changed.
Desired behavior after PR is merged:
The old syntax can be used.