closes#1800442
Purpose
=======
Odoo sessions are expired when no action has been triggered
for the last 7 days. For kiosk mode, this doesn’t make sense.
It means that once a week, a person with the rights to the
employee under kiosk mode, has to come to the screen and log in again.
Specification
=============
Trigger an action to keep the Odoo session alive.
On 'My attendance', do some check-in/out operations
while on the server side, everything was ok, the display had some issues:
On Chrome, that worked well whereas in Safari, it did not
since the Date() implementation only accepts ISO date strings
We take the opportunity of this fix to handle dates with moment.js, which accepts non-ISO formats
OPW 1831555
closes#23962
'session' is no longer an widget attribute, 'getSession()' should
be used instead.
Also remove a dead JS field widget (not used since
odoo/odoo@158f779b46)
With the new views, the barcode mechanisms were completely broken,
because the view and widget JS code was totally changed.
This commit update and refactor all that code to make it work with the
new design philosophy. Also, it update the coding style.
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly. This commit introduces the new rpc
system, which replace the previous new one. We now simply have a
method, this._rpc, which takes a dictionary of parameters. The idea is
that depending on the parameters, it is able to add correct default
value when necessary.
For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
The new views and widgets (at least some of them) first landed
in web_studio (v10), and they we moved later to web, so changes
in web_studio need to be applied in web.
* hr_attendance, hr_gamification, hr_recruitment, mass_mailing,
project, sales_team
Before this commit, the kanban column did not know about the model
name which make customization impossible without a getParent. Kanban
records were supposed to know about this thanks to the options
parameter but this was broken. Now the model name is automatically
initialized from the given state.
Adapt all extensions which relied on this.
This commit introduce a full redesign of all JS views. We started
basically from scratch. The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.
Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented
We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.
Work done by the framework team: mostly aab, ged, chm, dmo, qsm
- in employee form view: separate "Status" group from "Attendance" group
- make "Attendance" group only visible to attendance officers
this also fixes the use_pin group that would everyone to view pins if enabled
- in employee kanban view, fix the removal of the attendance widget to display
the fa-user icon again, instead of a simple red dot. (commit c468cfdd69 )
- Print Badge report set as pdf instead of html
- Replace the 'Status' separator by 'Attendance' in HR Settings tab
- Add a new Stat button 'Attendance' and set icon as a last action of employee
- 'Manual Attendance' field should only be visible if 'Related User' field is set
- 'PIN' field should only be visible if in setting enabled
- 'Payslips' stat button not displayed if user has no access rights
- If no start/end dates selected then '-' will be removed on 'Trial Period Duration' field
- Rearrange fields on employee form's 'Contact Information'
[IMP] Various usability improvments on attendance and HR application
This way you don't have to wait the 5 seconds, or click the "ok" button
to return the the kiosk mode to be able to scan the next badge.
Note: listener is disabled if a warning message is displayed.
+ small code/comments cleanup
PURPOSE
=======
For each and every Hr application there should be one user category (One app = one category).
SPECIFICATION
=============
HR remains as it is : Employee, Officer, Manager
Each Application should have 2 access rights: User and Manager. Example for Recruitment:
- The user has access to the recruitment process
- The manager has access to the job position configuration
Each Application should grant the employee user access right (Namely the 'HR Officer')
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:
- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
translated
The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).
Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).
This commit correct all the external ids tagged as from base or other incorrect
modules.
Employee presence indicator in kanban view could previously be confused with
other status indicators from other models that indicated that it was ready for
next stage (green dot).
improved by using fa-user symbol instead of dot.
- Migration to new API
- MODEL : hr.attendance now has check_in and check_out datetimes plus a computed field worked_hours, no more action (in/out) and no more reason.
hr.employee has extra fields: pin and barcode and can print a badge containing that barcode.
- the module contains : -> a menu "My Attendances" to check yourself in or out manually.
-> a menu "Manage Attendances" with 3 submenus:
- "Attendances" where you can edit attendances
- "Employees" where you have a kanban view of the employees (to see who's checked in or print badges)
- "Kiosk Mode": fullscreen, made to be at the entrance of companies to allow
all employees to check in and out, either with a barcode scanner to scan your badge
or by selecting them in a kanban view and checking in or out manually with or without
entering their PIN. (enable/disable in Configuration)
-> a menu "Configuration" where you can change enable/disable PIN use.
- GROUPS : -> HR manager (base.group_hr_manager): full access to the attendance module.
-> HR officer (base.group_hr_user): full access except the "Configuration" menu.
-> Manual Attendances (base.group_hr_attendance): only access to the attendance menu "My Attendance" to check in and out manually in the back-end
-> Employee (base.group_user): has no access to the attendance module. (should only check in and out through the "Kiosk Mode" put at his disposal)
- Views adaptation to the new fields, addition of a presence indicator (green/red dot) to employee kanban and form views.
The attendance module needs to know if the user is an employee before
putting itself in the systray. This commit add the information in the
session infos, and use it directly.
In the enterprise client, in mobile, the buttons in the systray are 'display:
inline-block'. This rule was overriden in the case of the attendance button
by a 'this.$el.show()', which changed the display to 'block'. This rev. uses
'do_show' and 'do_hide' functions of widgets instead, as they don't change the
display.
- Hide account_id field and add a required project_id field on timesheet entries
- Remove is_timesheet field: as project_id is only required for timesheet entries and not for other analytic lines, it can be used to determine wether a line is a timeheet entry or not.
- Remove project_timesheet module as all its functionalities are moved to hr_timesheet
- Replace timesheets on contract option on products by timesheets on project
- Small fixes and improvements in timesheets and projects views and groups
The module system needs to know the dependencies of a given module
before executing the function. This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.
But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
- Add a new SystrayMenu widget to improve and facilitate the way
of adding widgets in .oe_systray
- Rendering of the modules menu now waits for the systray and
user menus to be rendered
- A few refactoring of the UserMenu and Menu widgets