We were trying to sort a list of date with potentially falsy elements in
the list, causing a crash while trying to compare a date object with a
bool. This commit just makes the check that all dates are not falsy
before attempting to sort.
closesodoo/odoo#77012
X-original-commit: 6bd2a86e37809b4d77aad4597e926e99f9d2b2ce
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Purpose
=======
Currently, when setting a global leave for a company, the
leave validation raises an UserError if there is already a
leave on those dates.
Specification
=============
Manage the conflicts for easy tests cases:
- The global time off is taken in days
- The conflicting leaves are all in days/half days
For those use cases, refuse all the conflicting leaves
and recreate other one before and/or after the global time
off, according to the use case.
Taskid: 2230549
X-original-commit: 20ef422fea7793fc87dbf51c43699bb7872036f9
Purpose
=======
We want to allow different approvals for allocations and leaves of a same type.
e.g. In case of compensation days, a manager would approve the
allocation request, but would later not approve leave requests.
Specification
=============
Allocation modes
----------------
No change here except renames.
1. No limit (employee doesn't need an allocation to request a leave)
2. Allow employee requests
3. Fixed by Time Off Officer
Allocation approval
-------------------
A radio field to choose the approval mechanism
appears if the employee is allowed to request an allocation.
The following approval modes are possible:
1. Time Off Officer
2. Employee's Time Off Manager (leave_responsible_id)
3. Employee's Time Off Manager and Time Off Officer
These options are the same as leave approval options
(except the missing "No Validation").
If option 1 or 2 is selected, a o2m field should
allow to select which Time Off Officer is responsible
for approving those allocations.
Allocation approval policy is the same as the leave approval policy.
Task id: 1936742
Access rights based on task 1950998
Before this commit, if you had defined multiple attendances for the
morning or for the afternoon, the system would only use the first
attendance defined for either morning or afternoon.
This lead to wrong computations of the real leave length.
This commit fixes this issue by getting the min(hour_from) and
max(hour_to) for the attendances using a read_group.
closesodoo/odoo#36413
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When on leave, the im_status can be either leave_online or leave_offline.
This will allow to display a specific icon and a default message when the user
is not at the office.
The leave can have an out of office message. This message will be displayed
in the chat window instead of the user ooo message, and the end date of the leave will be displayed too.
Technical details.
Right now the im_status access leaves directly to know if a user is on leave or not.
An index has been added to optimise this request (thanks to rco).
A solution to optimise this would be to compute part of the information in a cron.
Task: 1856205
The tests have been detroyed while merging a refactoring for 12.0.
This commit reintroduces unit tests to checks each business cases from
"The Flow" into python tests.
closesodoo/odoo#28323
Purpose
=======
Currently if a department is modified on an employee, the department is
modified accordingly on the leave request if it still in 'draft' or
'to submit' states.
This should also be the case for confirmed leaves, if it is still planned
in the future.
Note: A test has been added for this specific use case.
TaskID: 1882544
closesodoo/odoo#27661
Purpose
- clean access rights;
- solve some access and security issues;
Access specifications
- an user
- can see all leaves;
- cannot see name field of leaves belonging to other user as it may contain
private information that we don't want to share to other people than
HR people;
- can modify only its own not validated leaves (except writing on state to
avoid bypassing validation);
- can discuss on its leave requests;
- an Officer
- can see all leaves;
- can validate "HR" single validation leaves from people if
- he is the employee manager;
- he is the department manager;
- he is member of the same department;
- target employee has no manager and no department manager;
- can validate "Manager" single validation leaves from people if
- he is the employee manager;
- he is the department manager;
- target employee has no manager and no department manager;
- can first validate "Both" double validation leaves from people like "HR"
single validation, moving the leaves to validate1 state;
- cannot validate its own leaves;
- a Manager
- can do everything he wants
In top of that, multi company rule are correctly added.
In reporting model using in "summary" name field should also be stripped
if you are not an HR officer and if it is not your own request.
Concerning allocation requests: implement same rules except constraint on
name field as it is less private and therefore can be seen.
This commit is linked to task ID 1876795 and PR #26656.
We need to support the accrual allocation for leaves.
This is a special type of allocations that adds some leaves to the
allocation every X amount of time worked.
This kind of allocations is especially used in the USA, but can also be
used in other contexts (eg: In Belgium we could allocate 20 days per
year for the legal leaves)
These allocations have support for :
* A max balance limit
* Going in negative (if set on the leave_type and the manager
approves the leaves)
* Removing the unpaid leaves from the quantity of days worked
* Setting an end date after which it does not allocate anymore leaves
Task #46114Closes#22292
We would like to have an overview of project forecast that include
leaves, for this we need to implement several kind of 'leaves' directly
in resource module.
These kind of 'leaves' can be defined via the hr.leave.type model (only
visible in base.group_no_one (choices currently are 'leave' and 'other')
* Add field time_type on resource.calendar.leaves
* Add a domain restriction that allows for filtering on this field
* Add tests
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
automatically in all countries thanks to Berne Convention + WTO rules,
and a reference to the applicable license is clear enough.
- added a workflow transition from refuse to draft, to allow resetting
a refused request
- resetting is now based on a can_reset field, taht is based on whether
it is my own request or I am an hr manager
- added an access right on crm_meeting that was preventing hr officers
to validate some requests
- improved form view to show reset to draft button accordingly
- added tests that helped trigerred the various bugs and improvements
bzr revid: tde@openerp.com-20130809144752-o21pjbc56o0t8fym