Commit Graph
59 Commits
Author SHA1 Message Date
pengyuthon 6b5469a4f0 chore(gzth): 天投云 Odoo 17 定制补丁汇总
本提交汇总生产环境长期定制改动(2024-11 ~ 2026-05):

- web 前端:list/calendar/form 状态指示/确认框/选择创建对话框等交互与中文化调整

- mail:mail_thread、models 定制(含多公司/权限相关处理)

- hr / hr_attendance:考勤与员工逻辑定制

- odoo/addons/base:ir_rule 记录规则调整

- bus/websocket、maintenance 视图、purchase_stock manifest、hr_contract zh_CN 翻译
2026-09-29 16:35:05 +08:00
Mahamadasif Ansari 679c813ec7 [FIX] hr_attendance: not filter attendance without check out
Currently, an error occurs when the user tries to open an employees
who checks in but does not check out.

Steps to produce:
1. Install 'hr_attendance'
2. Open Attendence > Attendences > create new
3. Set check In date previous month and no add Check out
4. Open employees > try to open current user

Error:  `'<=' not supported between instances of 'bool' and 'datetime.datetime'`

This is because https://github.com/odoo/odoo/pull/140629 added [1] in the
filter, but in certain cases, the `att.check_out` may not be present.

This commit fixes the above issue by filtering attendees who have
a check-out date.

[1]-https://github.com/odoo/odoo/blob/46f2a019bd141389233257f24f0ddae05b0fa008/addons/hr_attendance/models/hr_employee.py#L82

sentry-4616207347

closes odoo/odoo#141771

X-original-commit: b0cb1ad7b43a296b91377df80b30cbd3976553b4
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-11-13 14:38:36 +00:00
Thomas Lefebvre (thle) c7dd4d8242 [FIX] hr_attendance: take account lunchtimes
Steps to reproduce:
-------------------
- add lunchtime in an employee's calendar;
- in Attendance app, add attendance for
    this employee for the current month;
(The hours calculated in the attendances
take into account the lunchtime.)
- go to the form view of this employee;

Issue:
------
The statistics button, which displays the hours worked this month,
does not take into account lunchtimes.

Cause:
------
To find the hours worked, we calculate the difference
between the `check_in` and the `check_out`.

Solution:
---------
Use the `worked_hours` field of attendance, which takes into
account the employee's calendar and therefore lunchtimes.

opw-3547521

closes odoo/odoo#141282

X-original-commit: 94bd34af19d14da5deafd8f34f93ff71e35c8782
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-11-07 21:02:22 +00:00
Xavier Morel 9ebbfdac73 [FIX] *: incorrect translations markings
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).

Also

- removes translation markers entirely when there's nothing to
  translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
  (DRY is generally a bad idea when translations are involved, even
  more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
  strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
  to fill-paragraph): `\` escapes only the newline, if the
  continuation string is indented this results in a bunch of spaces
  ending in the string to translate, which is pretty garbage for the
  translator, using implicit concatenation works much better

Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.

Not in scope:

Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders

- Provides more context / data to the translator to make sense of the
  sentence.
- Allows reordering the translated terms, which can be necessary
  depending on the sentence and language.

closes odoo/odoo#139314

Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-23 16:45:09 +00:00
Jurgen (jugj) bf67f1e20e [IMP] hr_(holidays)_attendance : Revamp Attendance V17
Part-of: odoo/odoo#135439
2023-10-19 14:47:18 +00:00
dasz c68e4606f8 [IMP] hr,hr_presence,hr_attendance,hr_holidays: move presence computation to employee_base
Employee presence is not a sensitive data and should be available for all db users
this commit moves the computations from attendance, holidays and hr_presence to the
employee_base model, which is how it was originaly made in the hr module. This way
the presence marker does not depend on the user's hr rights

closes odoo/odoo#118437

Task: 3267790
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-31 15:53:54 +02:00
Marc Durepos c999f1ec14 [FIX] hr_attendance: prevent error caused by pre-fetching non-public employee fields
Fixes a situation where users who are part of the Attendances Officer (or Manager) group but
  without access to private employee data would see the following error when trying to book time
  off.

  `ValueError: Invalid field 'last_check_in' on model 'hr.employee.public'`

  Other instances of the same ValueError were observed by managers trying to approve employee leave
  and employee expenses.

  As per hr/models/hr_employee.py:22-26 fields not available on hr.employee.public should have
  groups='hr.group_hr_user' and this was not the case in hr_attendance.

closes odoo/odoo#120324

X-original-commit: ff4e7d6a414097d000e62825cf43425ea14bd77e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-03 08:38:13 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Kevin Baptiste 6610e7e183 [IMP] hr_attendance: add camera choice for barcode scanner
Add new settings to allow the user to select which camera to use for the
barcode scanner and to allow/disallow the manual identification of
employees.

task-2973809

closes odoo/odoo#99622

Related: odoo/enterprise#31082
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 09:23:47 +02:00
Rob Coekaerts 351bcdbb41 [REF] hr: Split hr_icon_display into two separate fields.
The icon that is displayed in the employee kanban view is determined by the
field hr_icon_display, computed in the method _compute_hr_icon_display. This
method is overridden in multiple modules such as hr_holidays, hr_attendance
and hr_homeworking.

Currently this field has a state to show no icon (presence_undetermined). In
this change this state is extracted into the a separate field
show_hr_icon_display with the default state of hr_icon_display being
presence_to_define. In this way a module such as hr_attendance, which only
overrides _compute_hr_icon_display to show the default icon for everyone as a
default, now only needs to change this separate field and does not need any
knowledge of what other states exist. This reduces coupling between modules.
2022-09-02 13:18:33 +02:00
Denis Ledoux 56a087284f [IMP] hr_attendance: do not allow employees to edit their attendances
Revision 7fd7422647
takes care to prevent employees to modify manually their attendances,
by removing the edit button from the attendance list.

This is only visual, this doesn't actually
prevent users to change their attendances,
for instance through XMLRPC.

Besides, with the group comment:
```xml
    <record id="group_hr_attendance" model="res.groups">
        <field name="name">User</field>
        <field name="category_id" ref="base.module_category_human_resources_attendances"/>
        <field name="comment">The user will gain access to the human resources attendance menu, enabling him to manage his own attendance.</field>
    </record>
```

To me:
- Employees should be able to sign in and sign out only
- Attendance users should be able to modify their own attendances only
- Attendance managers can modify attendances of anybody.

Hence, instead of removing the edit button on the view,
change the ACLs so employees do not have the rights to modify their
attendances at all.

Part-of: odoo/odoo#98551
2022-08-29 22:42:52 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Jinjiu Liu 38f65669de [FIX] hr_attendance: change the user group check for Kiosk
Reproduction:
1. Install Attendance app
2. Create a new internal user “kiosk”, with only access right “Kiosk
Attendance” for app “Employee”, other places as blank
3. Make sure the Settings for Attendance app, Employee PIN is unchecked
4. In an incognito tab, log in as kiosk, go to Attendance, click “kiosk
mode”, then “identify manually”
5. Choose an employee, with a warning message “Wrong pin”

Reason: A recent update refined the user group check for the
attendance_manual function. Checking if the user is an officer in the
Attendance app can be over strict. However, after discussing with yti,
we decided to pop up a warning message for security reasons when the
user would like to use Kiosk mode without pin code.

Fix: Add a warning message for higher access right requirement

opw-2898452

Related fix in V15: https://github.com/odoo-dev/odoo/commit/2975c0539d8c2781ff56a9f8be8e302d45b7d80b

closes odoo/odoo#96230

X-original-commit: 82f2966ed5b3afd30ac5b18c32af7993746fc681
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-18 19:56:00 +02:00
Yannick Tivisse 72682c22d8 [FIX] hr_attendance: Use orm cached method to improve perf
closes odoo/odoo#85557

X-original-commit: 2975c0539d8c2781ff56a9f8be8e302d45b7d80b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-03-01 10:53:48 +00:00
William Braeckman 93cd3d295f [IMP] hr_attendance: improve overtime display on attendance closing
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

closes odoo/odoo#77841

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 14:10:56 +00:00
William Braeckman 57f9b798af [FIX] hr{,_holidays}_attendance: compute correct default time off type
Previously the default time off type computed when pressing the deduct
extra hours button would not always be valid, this commits aims to
change that behaviour.

The form would also not recognize the fact that we are in a overtime
deductible context when the time off type was not bound to a company.

Task ID: 2607436
2021-08-23 08:09:47 +00:00
William Braeckman 2e17db2f51 [FIX] hr_attendance: fix necessary fields not present
`attendance_state`, `hours_today` and `last_attendnace_id` are required
to open up the attendance app, but were not available to the public user
since commit b429fce0e6

Task ID: 2607436
2021-08-23 08:09:46 +00:00
William Braeckman b429fce0e6 [REF] hr_attendance: change employee.base to employee
Moves the changes to employee from hr_attendance from the hr.employee.base
model to the hr.employee model.

Task ID: 1904850
2021-07-06 11:35:01 +02:00
Kevin Baptiste 9e6d2da504 [IMP] hr_attendance: compute overtime on attendances
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
2021-07-06 11:35:01 +02:00
Barad Mahendra 2cb194e1b5 [FIX] hr_attendance: Fix traceback on creation of employee
Currently, when you create a employee when hr_aattance is installed
then it will create traceback due to falder timiezone

so in this commit, Fix the issue and if timezone is not set on
employee then pass the 'UTC'

TaskID: 2283753
2020-08-21 06:07:59 +00:00
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.

Add sudo for other operations on ir.actions.*
2020-08-17 09:09:02 +00:00
Kevin Baptiste d24de2554e [IMP] hr,hr_attendance,hr_contract,hr_holidays,hr_presence: update employees presence icons
Make the employee presence icons more descriptive.
Allow to quickly filter the Presence Reports based on the user status.

closes odoo/odoo#54527

Taskid: 2246447
Related: odoo/upgrade#1488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-05 12:22:29 +00:00
jvm-odoo 28655ac9c3 [FIX] hr_attendance: fix last month worked hours
Issue

	- Attendances > Manager > Attendances
	- Create a line for any employee
		check-in 30/04/2020 12PM
		check out 01/05/2020 12PM
	- Go to Employees > the employee

	Last month worked hours = 0
	but it should be 12

Cause

	We only take into account records
	checked_out the previous month

Solution

	Rethink the whole method to
	take into account records
	checked_in last month and
	checked_out this month

	And adding timezone handling

OPW-2259533

closes odoo/odoo#51919

X-original-commit: 7918cccf0c6e28c25e909b1355eb7fda5373edb2
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-05-26 15:21:35 +00:00
Swapnesh Shah fb8a69706f [IMP] hr_attendance: use correct label in warning
Lable for the field `barcode` is `Badge ID`.

With this commit, We display the correct field name in the Warning.

closes odoo/odoo#50700

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-05 18:25:08 +00:00
Nicolas Martinelli e42aa1e344 [FIX] hr_attendance: do not allow grouping
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

closes odoo/odoo#38120

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-08 08:13:21 +00:00
Sapan Zaveri dafb128c14 [IMP] hr, hr_attendance: badge creation and few usability improvement
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>
2019-08-09 08:36:52 +00:00
Kevin Baptiste e9d9898276 [IMP] hr: Review the UX for 'My Profile' view
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

closes odoo/odoo#34180

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-18 10:27:50 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Lucas Lefèvre f6fdde96bd [IMP] hr_*: Improve employee presence state
Purpose
=======
There are currently multiple ways to determine if an employee is presence
or absent:
- login state (user status on chat)
- checkin/checkout from the Attendance app
- leave
- hr_presence (email, ip)
Those states are displayed in several different places and can be inconsitent.
e.g. Logged in -> green in the chat
Not checked in -> red on the employee kanban view.

The multiple ways to determine employee presence described above
should be aggregated together to have a better consistency.

Specification
=============
There are 3 presence states (previously defined in module `hr_presence`),
namely `present`, `absent`, `to_define`. They are now defined as soon as
`hr` module is installed.

The state computation can have several behaviors according to which apps
are installed:

1. `hr` is installed
Check employee presence based on login by default (only for employees with
a user).
Kanban state (private and public): should be green when logged in, red when logged out and
orange when the user is away.
Private employee form: Display a stat button "Connected" on the form view
when the user is logged in or "Last Activity xx/xx/xxx" otherwise.

2. `hr_attendance` is installed:
when the user is logged out, the state
is determined from the checked in/out state. But when the user is logged in,
consider the user as present (even if he checked out).
Kanban state: green for checked in, red for checked out
Private form view: attendance stat button.

3. `hr_holidays` is installed:
Has the highest priority if the employee is on leave.
Kanban state: red if employee is on leave.
Private form view: stat button "Absent Until xx/xx/xxxx" if employee
is on leave.

4. `hr_presence` is installed:
Two additionnal presence checking option: emails sent and IP address connected.
Once a user sent an email or the IP address was connected, he is considered
present for the entire day.

There should be at most one stat button on the employee form view, with the
relevent information.

Task id: 2024482

closes odoo/odoo#34933

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 09:11:18 +00:00
Raphael Collet b7fd679a6c [FIX] *: sudo() -> with_user() 2019-07-04 11:32:22 +00:00
Lucas Lefèvre ee1776dc5f [IMP] hr_attendance: Display checked in hours today
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.

closes odoo/odoo#33974

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-26 06:52:31 +00:00
Lucas Lefèvre 84517aabf6 [FIX] hr_attendance: Allow to checkin and checkout
Since 1594f82 a user can no longer checkin/checkout if not
in kiosk mode (warning "Wrong Pin").
The mentionned commit revealed a previous mistake: the pin was
never checked if `None` was provided because superuser does not have
group `hr_attendance.group_hr_attendance_use_pin`.

Pin checking should work as follows:
- For the logged in user: he should be able to checkin/checkout
without his pin through the "My attendances" action and with his pin
in kiosk mode
- For other employees: they should only be able to checkin/checkout with
their pin through kiosk mode.

The opportunity is taken to make method `attendance_action_change` private.

closes odoo/odoo#34058

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-06-12 12:24:36 +00:00
RomainLibert 1594f82780 [IMP] hr_attendance: Adapt module with new hr.employee.public model 2019-05-31 10:21:20 +02:00
Lucas Lefèvre d77ce4c2a9 [IMP] hr_*: introduce the employee profile
General Purpose
===============

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the hr module is installed
and the current user is linked to an employee.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by groups="hr.group_hr_user".
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access
to the regular user's own data.
A similar mechanism already exists for res.users (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on res.users.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to SELF_[READABLE | WRITABLE]_FIELDS

Note:
When the front-end loads the views it gets the list of available fields
for the user (according to its access rights). Later, when the front-end wants to
populate the view with data, it only asks to read those available fields.
However, in this case, we want the user to be able to read/write its own data,
even if they are protected by groups (groups are kept on the related fields on res.users).
The front-end need to be made  aware of those fields by sending all field definitions.

hr_attendance
=============

This commit integrate attendance in the new employee profile.
It also adds a stat button to this employee profile showing
the number of hours worked last month.

Remove the boolean computed field 'manual_attendance'.
This field is just a shortcut to add/remove the employee's user
in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should
be done through the normal group management screens.

hr_presence
===========

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present),
orange (to define) or red (absent).

Currently, the presence status is only computed when accessing
the report view. As this commits displays it on the employee kanban,
it should be updated more frequently.
The state should not be updated every time the kanban view is loaded
since the computation is a bit heavy. Instead: add a cron to update
status every 15 minutes.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 15 minutes on the kanban view

[ADD] hr_attendance_presence
============================

Bridge module between hr_attendance and hr_presence.

This commit integrates hr_presence module in the employee
profile and adds the presence status on the employee kanban view.
But hr_attendance adds at the same place a similar status icon for
checkin/checkout.
This bridge module makes the status from hr_presence invisible as
hr_attendance should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option)
for hr_presence to take into account checkin/checkout to determine
the presence status.

l10n_be_hr_payroll
==================
integration with employee profile
2019-02-14 16:28:54 +01:00
pha-odoo f14092cbfa [IMP] point_of_sale: Connect with Employee on PoS
=========
PURPOSE
=========

{Any employee can work on a PoS session, even if he has no user. This decreases the cost of PoS App.}

We are not competitive enough on the PoS Market because customers have to pay one user per cashier while they expect to pay one user per cash station.

===============
SPECIFICATIONS
===============

pos.config
- Add a checkbox : "Login with Employees"
- If set to TRUE, an "Allowed Employees" many2many appear
- If employees many2many is empty, all employees can log on this PoS
- If set to FALSE, can only log in with the currently logged user

hr.employee
- The barcode and pin fields were be moved to the hr.employee
- Set a barcode (not pin) by default at the creation of any employee
- No Employees module with PoS > dependency to hr

Open the PoS if "Log in with Employees" = FALSE
- Same behaviour than now, when I open the PoS, I'm logged in with the current user and can start working at once. The only difference is that it is not possible to switch users anymore.
- The button to close the session is visible

Open he PoS if "Log in with Employees" = TRUE
- When I open the PoS, the first screen I see is the login screen.
(a) I choose my employee and enter my pin code (if there is pin code on my employee, otherwise not required) (I can only see employees that have access to that PoS)
(b) I scan my barcode
(c) I scan my rfid card (future development)
- When I click on the employee name, I can log in with another employee
- If the employee is linked to a user that has the pos user/manager access right, I can see the button the close the session. Otherwise I cannot close the session (and thus cannot access backend).
- Add field employee on all records created by PoS (and replace the field user by that one) (on pos.orders)

Lock Screen
- Improve the PoS Interface
- Add a new feature to allow to "lock" the session. When a session has been locked, the user/employee has to re-log-in to access the PoS
- When I try to re-log-in, by default suggest the last employee logged in in the login screen

Migration
Plan a migration strategy > barcode and pin is now on the employee and not on the user anymore

closes odoo/odoo#28567
2018-12-07 14:31:56 +00:00
Christophe Simonis efe7ca16b7 [MERGE] forward port branch 11.0 up to bb6f6c57f9 2018-11-28 17:44:46 +01:00
Alexandre Saunier 1d2a4d8459 [IMP] hr_attendance: faster loading of employees kanban view 2018-11-22 12:22:36 +00:00
Christophe Simonis f66a9cdbcf [MERGE] forward port branch 11.0 up to bab5ccfdd7 2018-11-05 17:51:04 +01:00
David Beguin f20cd3db75 [FIX] hr_attendance : kiosk mode multi scanning
- Scan a barcode for employee 1 in kiosk mode
- At greetings message, scan a barcode for employee 2

2 attendance entries are created for employee 2 instead of 1.

When scanning the barcode for employee 2, the event listener
`_onBarcodeScanned` is still active on `KioskMode`. Therefore, the RPC
call to `attendance_scan` is performed twice.

We deactivate the event listener after scanning, and reactivate on
`KioskMode` only if there is an issue. This is sufficient since the call
to `do_action` in `GreetingMessage` will create another instance of the
client action. In `GreetingMessage`, we add back the redirection to
`KioskMode`.

Co-authored-by: Nicolas Martinelli <nim@odoo.com>

Linked to Task ID 1878251
opw-1878632
opw-1888402

closes odoo/odoo#28150
2018-10-31 14:35:27 +00:00
Christophe Simonis 96e5455079 [FIX] hr_attendance: compute attendance state as sudo()
Since `last_attendance_id` is stored, `sudo` is needed as employees
doesn't have access to their collegues attendances.
2018-05-15 13:51:02 +02:00
Kinjal Mehta c91d44aef5 [IMP] hr_attendance,hr_contract,hr_expense_check,hr_payroll,hr_recruitment: changed duplicate field label in the same model 2018-01-04 17:56:54 +05:30
Prakash Prajapati 2e038cc6bd [IMP] hr_attendance: allow to search for "signed in/out" employees 2017-10-20 09:50:06 +02:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Goffin Simon 5d27b3d6c0 [FIX] hr_attendance: Wrong timezone
The timezones are already managed in the JS.
So on the attendance check in/out screen when a user clocked out
after 8 hrs he got a message saying that he has been in for more than 12 hrs.

opw:710161
2017-03-01 15:39:48 +01:00
Denis Vermylen 1c2e3d3838 [FIX] hr_attendance, hr_*: move group_hr_attendance to hr_attendance
move group_hr_attendance from hr -> hr_attendance where it belongs.
2017-01-26 19:19:19 +01:00
Goffin Simon 2db449a2ae [FIX] hr_attendance: check in with blank pin
When writing a blank pin, the user logged can check in his own related
employee.

opw:703744
2017-01-11 14:02:05 +01:00
Goffin Simon 78646696b8 [FIX] hr_attendance: attendance_manual
In Kiosk mode, the user logged cannot check in and check out his related
employee with any wrong pin.

opw:703744
2017-01-10 15:26:11 +01:00
Christophe Simonis 366b01f079 [FIX] hr_attendance: get group via xmlid instead of searching via name match (which will not works in other languages) 2016-10-03 16:31:01 +02:00
Denis Vermylen (dve) 9fc91bd354 [FIX] attendance: forgotten rename
couldn't find a group after rename. -> renamed
2016-10-03 16:20:03 +02:00
Denis Vermylen (dve) 2c13736cbf [IMP] attendance: help messages, comments, ...
- improve some help messages
- improve comments
- small refactoring
- add category to group "Manual Attendance"
2016-10-03 15:19:21 +02:00