Commit Graph
48 Commits
Author SHA1 Message Date
Barad Mahendra 51399445a3 [IMP] hr_holidays: support document on Time Off based on Time Off type
Currently, it's possible to add supporting documents on the chatter of
the time off. But it's not easy to use and doesn't make really sense.
So we will add the possibility to add it more easily.

So in this commit,
 - Added 'Supporting Document' on Time Off type to support the
attachment based on types.
 - On new Time Off, if the Time Off type has a support document then allow
uploading the supporting document in form view.
 - The File is recorded on the chatter of the Time Off request.
 - There will be synchronization between chatter and form attahcments.

PS: added non-stored m2m field to display the attachment view(m2m_binary)
in the form view as o2m does not support it.

TaskID: 2431478
2021-04-13 13:38:31 +00:00
Christophe Monniez e42a5342ee [FIX] hr_holidays: fix typo in relativedelta days
In relativedelta, `day` means day of the month and `days` is for number
of days. Today, the demo data failed because the computed `date_to` was
before the `date_from`.

closes odoo/odoo#68632

X-original-commit: 67cb39aa74ae60dd069bf552ed06c878ec643f9c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-04-01 07:43:08 +00:00
Xavier Morel de58031589 [FIX] hr_holidays: possible overlaps between PTO and weekends
Followup to odoo/odoo#65314: turns out there's a bunch of other leave
requests in the file which will eventually fall on a weekend, and will
probably blow up due to the new validation in 14.0:

- hr_holidays_sl_al in March 2021 because April 17th, 2021 is a
  saturday
- hr_holidays_cl_mit_2 in June 2021 because June 5th, 2021 is a
  saturday
- hr_holidays_sl_vad in September 2021 because September 25th, 2021 is
  a saturday
- hr_holidays_sl_kim in April 2021 because May 1st, 2021 is a saturday
- hr_holidays_sl_kim_2 in March 2021 because July 3rd, 2021 is a
  saturday

Solution
========

Instead of hard-coding month-days, move to the first monday after the
original date e.g. if we were looking for the 20, now get the monday
after the 22. In relativedelta terms, `weekday=0` is "the next
monday". The date is then formatted inclusive of the month-day rather
than hard-coding one.

One nit is for the end date:"the next wednesday" may come before "the
next monday" if we're on TU or WE. So we need to first jump to the
next MO *then* to the WE after that, which makes the code a bit
longer (and more redundant). As a result the end date is now "the
wednesday after <the start date>" rather than being a literal 2 days
later or whatever.

The PR updates all the 1-day and 2-day intervals, it also updates the
3 days inclusive (those over 3 which include start and end dates
rather than without) including those updated by #65314 for clarity /
coherence of small intervals. Longer intervals are left untouched,
although we may eventually want to update them so `number_of_days`
computations are more reliable.

Redundancy issues
-----------------

There are a bunch of redundancies / verbosities which don't seem
easy or possible to remove:

* While lxml does resolve entities by default it doesn't load
  DTDs (let alone validate them), aliasing various datetimes
  & deltas as entities is not an option, not to mention for security
  reasons we'd rather stop resolving entities entirely than allow
  custom ones.
* While it's possible to define nested safe_eval'd `context` on nodes,
  the evaluation context for *those* contains neither datetime nor
  relativedelta, so storing a bunch of constants in the (environment's)
  context and using that in the expression is not an option either.
* Leaving `date_from`/`date_to` off of some records breaks, probably
  because some other field necessary to properly compute *them* is
  missing.

Other changes
=============

* Removed explicit settings to `number_of_days` and explicit calls to
  `_compute_number_of_days`, seems redundant and unnecessary as the
  compute works fine as long as we let it.
* While at it, updated the calls to `action_approve`: moved them next
  to the corresponding record (instead of being on the other side of
  the file) and used direct references to the subject records rather
  than complicated searches.
* Also updated two leave allocations to be created validated OOTB
  instead of manually calling action_validate as that's what's being
  done elsewhere in the file.

Notes
=====

* In relativedelta lingo, "the next X" is inclusive of the current
  date e.g. when looking for the next WE, if the date being offset is
  already WE there will be no movement, this can be unexpected.
* Normally relativedelta would be used with the MO/TU/WE/... constants
  for weekdays, but we're not exposing those to `@eval` so integer
  literals it is.

closes odoo/odoo#65430

X-original-commit: 7840b21483c0012174e6028a39b114ce56f06158
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-02-02 18:05:14 +00:00
Martin Trigaux 0a50436e5a [FIX] hr_holidays: include time in demo data
All fields not provided default to 0, so the the exact values are
`%Y-%m-20 00:00:00` - `%Y-%m-22 00:00:00`.
Because this is only 2 days it can entirely overlap with a week-end
(e.g. 2021-02-20/21), leading to `number_of_days` computed to 0 and
triggering an error at confirmation (`"The following employees are not
supposed to work during that period"`).

Change familly trip as the same issue would occure in May 2021

closes odoo/odoo#65326

X-original-commit: ada1da9a0cea6aaa3f91ee34fd3b273be79e1e3d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-02-01 11:17:27 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Yannick Tivisse d2238de576 [IMP] hr_holidays: Improve the general usability (back2basics)
closes odoo/odoo#55568

Taskid: 2282495
Related: odoo/upgrade#1574
Related: odoo/enterprise#12272
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-11 09:10:49 +00:00
Victor Feyens d4e0fe018d [IMP] *: use ref= instead of eval="ref(' in xml field tags.
* Code cleanup
* Avoid a safe evaluation of the field value when loading those records.

closes odoo/odoo#44883

Related: odoo/enterprise#8283
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-02-11 13:07:06 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Lucas Lefèvre 8f3a5068ca [IMP] hr_holidays: Add specific approval for allocations
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
2019-11-22 16:58:38 +01:00
Yannick Tivisse 285f2f9d47 [FIX] hr*: Grant user's rights to demo user for HR applications 2019-09-23 07:56:12 +00:00
RomainLibert 02599afd49 [FIX] hr: Rename Gilles Gravie
closes odoo/odoo#37122

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-19 09:38:49 +00:00
RomainLibert 7d06ac1d69 [FIX] hr_holidays: set responsible on leave types 2019-09-11 09:27:41 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Yannick Tivisse abd73d61a2 [IMP] hr_holidays: Improve general UX (back2basics)
TaskID: 2053585

closes odoo/odoo#35737

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-16 11:24:04 +00:00
RomainLibert e0b16b22e8 [IMP] hr_holidays: Improve general UX (back2basics)
Purpose
=======

Having a clean policy in leave access right. If there
are some internal need or bugs, read this before decided
if it is an expected brhavior or not. It is what we want
in a standrard point of vew.

Specification
=============

Access rights Policy
--------------------

Remove Time Off - Team Leader access right

Leave_manager_id is now requried, by default it
is = parent_id for admin it is admin by default (data
employee_admin)

3 access rights:
- Internal User
- Time Off - All Approver
- Time Off - Administrator

3 fields for "manager"
- parent_id
- leave_manager_id
- manager_id on department

Department
Is just there for information. So never use it in
default filters

Rules Policy
------------

Don't forget to take the leave type configuration into
account
* no validation means automatic
* officer validation means you need to be at least
holidays_user to approve
* manager validation means anyone who is at least
leave_manager_id can approve

Internal User
-------------

In double validation mode he:
- can only do the first approval
- can see the everyone's leaves with a anonymisation of
the leave description
- can create a leave (even if leave type is directly approved)
- can refuse its own leaves (till not reported in payslip)
- can reset to draft his own leaves and reconfirm them
- can delete a leave in draft state
- can cancel a leave if the date_start is in the future
- cannot validate its own leaves

If leave type is configured in manager mode, he:
- can approve or refuse the leaves if he is leave_manager_id

If leave type is configured in both mode, he:
- can only do the first approval or refuse for the leave
if he is leave_manager_id

Time Off - All Approver
-----------------------

In double validation mode he:
- can only do the second approval
- can see, write, read all leaves and perform the second
approval.
- Can set a leaves as reported in payslip.
- Cannot validate its own leaves
- cannot configure leave type
- cannot create leaves in batch

Time Off - Administrator
------------------------

In double validation mode he:
- can do all the approvals
- can bypass all leaves (approve or refuse).
- can configure Time Off Types
- can create batch leaves
- can validate its own leaves

Menu
----

- My Time Off (access rights: internal user)
- Dashboard
- Time Off Requests
- Allocation Requests
- My Team (rename into "Everyone", access rights: internal
user. default filters on current year and group by
employee; default view: gantt can switch to list and form)
- Managers
- To Approve (internal user who are leave_manager_id
see and can approve. See only leave he has to approve
(domain))
- Time Off
- Allocation
- All
- Time Off
- Allocation
- Payroll
- Time Off to report.
- Reporting (access right: time off administrator)
- Time Off Analysis
- Report by Department
- Configuration (access right: time off administrator)

Usability
---------

- In all list of "manager menus", add actions to change
status in mass
- In leave type data:
- move Home Working from data to demo data
- There are 2 Paid time off, get rid of the company on
it and share it on all companies (keep only the one
in data)
- Leave type like this:
- Overtime Compensation/compensatory days (keep only
one of both, to avoid having 2 same leaves in
demo data). Validation by: team leader and hr
officer, no validity date
- Paid Time Off 2019. Validation by Team Leader
and Payroll Officer. Remove validity, remove 2019.
- Unpaid. Can be taken in hours. Approved by Payroll
officer and team leader. No allocation needed.
- New leave request: order of leave type in the m2o:
1. leaves where allocation are fixed by rh and remaining
> 0 and allocated > 0
2. leaves where free allocation. Where reaming is > 0
and allocated >0
3. One already taken
4. All other leaves.
- Remove the sequence widget in leave type
- The employee should get a notification when his leave is
refused "Your "leave_type_name_" planned on "start_date"
has been refused"
- from the dashboard calendar, the reset to draft should lead
to edit (avoid user has to click on edit)
- An employee should be notified when a leave is approved
"Your [leave_type_name] on [start date] has been approved"

Leave Dashboard V2
------------------

https://drive.google.com/file/d/1pMCqDlecqM7ngvmhJJdWtkG2_GiXHyIX/view?usp=sharing

Testing
-------

Everything concerning the leave requests has to be tested.
All the access rights have been reviewed and need testing.

Migration
---------

Don't forget to keep the filters in the calendar view (otherwise RIP perfomances and usability)

TaskID: 1950998

closes odoo/odoo#33813

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-23 08:21:55 +00:00
Christophe Simonis 5548029fb7 [MERGE] forward port branch saas-12.4 up to 5e81b18e24 2019-06-27 20:51:59 +02:00
Christophe Simonis cf51b5f25d [MERGE] forward port branch saas-12.3 up to 793933a128 2019-06-25 14:23:48 +02:00
Christophe Simonis e6cf33bd32 [FIX] hr_holidays: force empty validity start date on data/demo leave types
Oversight of previous forward-port.
2019-06-21 11:45:54 +02:00
RomainLibert e4101e3857 [IMP] hr_holidays: avoid taking leave only on the week-end
In demo data, Marc demo was taking a sick leave during the first and
second of the month, the problem is that when the current month starts
with a saturday this leave ends up being placed only during the
week-end hence no leave should have been taken.
In order to avoid having this weird leave, Marc demo will now take three
days of sick leave

closes odoo/odoo#34318

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-24 08:32:23 +00:00
Lucas Lefèvre 29e6a42df4 [IMP] hr_holidays: Set request_date_from|to in demo data
The two fields of leaves `request_date_from` and
`request_date_to` are not set in demo data.
These fields are displayed in the form view and are
empty.
This commit add values for these fields to have
a nice and complete form view.
2019-05-17 11:22:15 +02:00
Christophe Simonis 2602642a78 [IMP] mail,*: remove useless field is_master_data
This field is a non-sense. By using the same logic, it should be added
to any low level model.
Replace the check by a simple verification of presence of an XMLID.

A more generic opt-in solution should be integrated into ORM.

Partially revert commits 0db0e66e96 and
bbd64c22ab.

See #29257 odoo/enterprise#3550

closes odoo/odoo#31778

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-12 10:29:51 +00:00
Mohit Ghodasara bbd64c22ab [IMP] various: prevent unlink of automated activity types
Purpose of this merge is to update main addons and set activity types used
for automated activities as master data. This means they cannot be removed.
Indeed those activity types are used in business flow to generate activities
and removing them may break some flows.

This commit is linked to task ID 1907970 and PR #29257.
2019-02-05 11:32:14 +00:00
jbm-odoo a3daff6bc1 [IMP] hr_holidays: Rename 'leave' into 'time off' + add dashboard
Purpose
=======

We need to use an international word to define holidays and leaves, rename everything into Time Off.
Employees needs a good dashboard and leaves summary

Specification
=============

1/ Add a new dashboard: https://balsamiq.cloud/sm5j0d/pg5w04r
   Create a new dashboard with a calendar and a summary of all time off and time off request
2/ Rename leaves into Time Off everywhere
3/ Improve general usability

TaskID: 1916871

closes odoo/odoo#29634
2019-01-21 11:29:30 +00:00
Christophe Simonis 99d0e1b80e [MERGE] forward port branch 12.0 up to a403155dec 2018-11-12 13:06:48 +01:00
Christophe Simonis d226f8b4ff [FIX] hr_holidays: set leave types as noupdate
They should not be updated using current year.
2018-11-06 20:02:06 +01:00
jbm-odoo 863713b5bd [IMP] hr_holidays: add demo data
The module lacks demo data to have a nice visual display when testing the application

Add allocation requests and leaves request for several employees

TaskID: 1906478
2018-11-06 12:08:46 +00:00
TWA 398f0eb8e9 [IMP] hr_holidays: Define notifications by leave type
Purpose
=======

- A manager could want to follow only home working of its own department
- A HR officer could want to follow only sick leaves of all dpts.

We have to improve what people follow and how they follow it in the leaves module

Specifications
==============

Subtype on department
---------------------

In department form view, right now, people can follow approvals

Instead we should have some generic and specific subtypes depending on the leave type

For instance, a HR Officer wants to follow only sick leaves and a manager only home working

Following mechanism
-------------------

Remove first / second approval subtype differences
if a leave type is not linked to a specific subtype, consider only classic
people follow it (employee and assigned HR people / manager)

Link leave type to subtypes, with some by default (i.e. home working, ...), not mandatory

When creating a leave type, link it to the department to be able to
activate the subtype for only one department.
2018-10-19 07:52:41 +00:00
Thibault Delavallée 14491e8f9b [REF] hr_holidays: clean fields used to store and display duration
Purpose of this commit is to simplify fields used in leave and allocation
used to store the duration of the requests. We want notably to get rid
of "number of days temp" that, contrary to its name, is not temporary
at all as it stores the real number of days. We also want to clarify
the hours or days encoding that is different on leave and allocation models.

Specifications

 * number_of_days on leave and allocation is the master field holding the
   leave or allocation duration in days;
 * two fields are used for interface that are suffixed by _display in order
   to indicate they are UX only: number_of_hours_display and number_of_days_
   display. They are interface fields used for the user and correct number
   of days is computed and stored in number_of_days;
 * more specifically for leave model

  * display fields are readonly as it is computed based on dates given by
    the user, directly (from / to) or indirectly (half-day leaves for example);
  * duration field is computed through an onchange. It could be directly
    set by hand by managers if some confusion in the number of days appear;

 * more specifically for allocation model

  * display fields trigger an inverse as they are the real duration given
    by HR officers or managers;
  * duration field is computed through the inverse of display fields;

Various reports, data and use of leave / allocation models are updated to
use the correct field.

This commit is linked to task ID 1876795 and PR #26571.
2018-09-10 13:08:57 +02:00
Thibault Delavallée bd5b2c9466 [REF] hr_holidays: simplify leave type configuration
Purpose of this commit is to simplify the configuration of leave type and
use the job of HR officers / manager by making options clearer and easier
to use.

Specifications for leave type :

 * display name as header;
 * remove accrual option from leave type. It is now configured directly
   on allocation requests;
 * add a "X days allocated" stmart button. If you set a general allocation
   of 20 days, the stat button will display 20 days. Even if you go update
   the allocation by employee after that. Purpose is to have the value of
   main allocation done in group, not individual cases of some employees;
 * add a "Group leaves" stmart button. It leads to a new leave requests
   in group mode where mode is visible;
 * have a unique allocation type field replacing the setting allowing to make
   leave or allocation as well as limit and negative fields;
 * limit leave duration encoding to two options, either day-based (allowing to
   take full days or half a day), either hours-based (allowing to take full
   days, half a day or some specific hours in a given day);

More technically

 * limit and negative fields are removed. It was confusing as limit set to
   True means you can actually exceed the limit). It can be computed based
   on allocation_type ('no' meaning you can bypass the limit);
 * request_unit is simplified. Day and half are merged into day;
 * accrual and balance limit are moved to allocation model;

Specifications for allocation requests

 * set accrual specific on allocation itself and not coming from the leave
   type configuration anymore. Indeed we now consider accrual to be done
   case by case independently from the leave type;
 * remove negative and balance_limit. Indeed we now consider people have to
   check by hand what is done by accrual;

Leave and allocation are slightly impacted by other changes, such as domain
for default leave types. Changes have been made as small as possible. Future
commits will still improve leave and allocation models and views, going
further in the cleaning process. Some tests are udpated to match the new
configuration of leave type.

This commit is linked to task ID 1876795 and PR #26571.
2018-09-10 13:08:53 +02:00
Thibault Delavallée 2b70abe484 [FIX] hr_holidays: allow to reinitialize module
Demo data prevent from reinitializing hr_holidays module. Indeed confirming
already confirmed leaves or allocations does not work. Demo data are
updated so that we can initialize hr_holidays several times.

This commit is linked to task ID 1876795 and PR #26423.
2018-08-27 14:25:33 +02:00
Raphael Collet 2f7c03d9ca [IMP] base: add regular user admin as uid 2
User 1 simply becomes a technical user (inactive, no password).
2018-08-23 21:38:57 +02:00
RomainLibert a8aa0bcbbe [IMP] hr_holidays: add accrual allocations support
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 #46114
Closes #22292
2018-06-08 14:41:05 +02:00
RomainLibert b6642f1b70 [IMP] hr_holidays: add support for taking leaves differently
We would like to be able to take leaves using different units, currently
we only support taking leaves by hours because we use datetimes.

We need to support three units:
 * days
 * half days
 * hours

These units will be defined on the leave type.

Task #40995
Closes #21760
2018-06-06 17:04:07 +02:00
Thibault Delavallée 1d71c06233 [IMP] hr_holidays: improve activity management on leave model
This commit improves leave request and allocation management through a
better integration of activities and addition of automated activities.
Several things are done in this commit :

 * leave and allocation models do not inherit from mail.activity.mixin.
   This commit adds the inherit so that HR users and managers can now
   schedule and manage activities on leave and allocation requests. This
   will help them in their daily job;
 * automatic activities generation is added for leave and allocation.
   Activities are generated for approval and second approval. They are also
   automatically set as done when validating or unlinked when refusing or
   resetting to avoid bloating users with unnecessary activities;
 * a menu to configure activity types is added. Indeed HR managers should be
   able to see and configure activity types related to their job;
 * filters are added to be able to use the systray and to filter the kanban
   view based on activities

Having automated activities allow to replace some messages and tracking
that were implemented to warn people of leave and allocation to approve
or validate. This commit therefore

 * simplifies the tracking as only approved or refused state now trigger
   a subtype;
 * removes to approve and to validate subtypes on leave and allocation
   model as well as their parent subtypes on the department. This allows
   to simplify chatter a lot in hr_holidays app;
2018-03-27 15:19:10 +02:00
Thibault Delavallée 0e595ee81a [MOV] hr_holidays: split data to separate mail data from other data
It is simpler to have data split by main model or application like we
already do for models and views. It allows to easily have an overview
of data a module holds.

As we will work on mail related data like adding activities or tweaking
subtypes and templates, having them all in a single file and not lost
between other data helps finding and working with it.

This commit only moves code. No functional change should occur.
2018-02-21 16:46:53 +01:00
RomainLibert df324c8857 [IMP] hr_holidays: Improve leave type: limit date, visibility, usability
In order to help limit leaves recording errors. We need to add some
configuration on leave type object. For example we need to avoid people
taking legal leaves 2016 on 2017.

  * Add validity dates : start and end dates on the leave type. An empty
    end date means forever
  * Double validation : change the checkbox into a radio button with now
    three choices :
  	- Human Resource Responsible
	- Manager
	- Double Validation
  * Add a sequence field, using handle widget
  * Add a field, to specify if the employee can select the leave type in
    his allocations, requests or in both of them
2018-02-14 17:26:31 +01:00
RomainLibert a0f4f6548b [REF] hr_holidays: Split/Rename models/views according to guidelines
Purpose
=======

Follow the coding guidelines (https://www.odoo.com/documentation/11.0/reference/guidelines.html)

Specification
=============

* each model has now its own .py file
* view files have better names
* reordered the methods for readability
* reimplemented email subtypes
2018-01-15 10:38:31 +01:00
RomainLibert f61687a4cd [IMP] hr_holidays : split hr.holidays into hr.leave and hr.leave.allocation
Purpose
=======

Have a clear distinction between leave and allocation requests instead of
using the same model to mix 2 different concepts.

Splitting the model will allow different business code to be run on each
model as allocations and leaves are not exactly the same thing; this
will add some code but simplify future improvements

Specification
=============

1/ Completely separate the models

Model hr.holidays has been split into leave.request and
leave.allocation.

2/ Make reporting working again by using an SQL view aggregating data
from leaves and allocations

A new report has been added in order to aggregate
datas from both allocations and requests. The views have been modified
accordingly.
2018-01-15 10:38:31 +01:00
Richard Mathot f9a189e07e [FIX] hr_holidays: poorly designed demo data
If an user (or a developer) wants to install this module twice, she
could not before this patch. Because those demo data call a function
that crashes if the state of the demo data has been modified... and
modifies it!
We avoid this issue by resetting the states of the demo data
explicitely (before a deeper refactoring)
2017-12-06 17:00:25 +01:00
Dipali Tank 00f90a70ed [IMP] *: holidays -> leaves
The meaning of "holidays" may vary in the UK/US.
2017-08-08 11:53:03 +02:00
Fabien Pinckaers eee806e4a4 [IMP] *: remove #general messages at module installation 2017-01-07 21:31:11 -08:00
Denis Vermylen (dve) 6a8e4c6119 [REF] hr_holidays: replace workflow by python code 2016-09-02 10:16:49 +02:00
Denis Vermylen (dve) 0ea478652a [FIX] hr: employee data and demo data
addendum to commit da6b9d1be443999028f021ff81b4cf128a4eaaa2
- better employee name and image for default employee in data (xml-id: hr.employee_root)
- in demo data hr.employee_fp renamed to hr.employee_root to not have 2 employees linked to the root user
- renamed all occurences of employee_fp to employee_root
2016-07-04 17:19:23 +02:00
Ravi Gohil 46bc624479 [IMP] hr_holidays: a few code improvements
- added encoding to xml files
- replace search_read() with search() for _search_absent_employee()
- fixed setting first date of current month as default value for wizards
- reduce calls to <dict>.get()
2016-06-15 09:47:10 +02:00
Ravi Gohil 46ccb7036f [MIG] hr_holidays : migration to new api 2016-06-07 16:34:54 +02:00
Ravi Gohil ea2e476606 [MOV] hr_holidays: reorganize module directory
Also,
- removed unused hr_bel_holidays_2008.xml file
- removed unused action with xml_id 'act_hr_employee_holiday_request_approved' from hr_holidays_views.xml
2016-06-07 16:34:54 +02:00
rsi-odoo 1a2b4f4de7 [IMP] hr_holidays: Convert Leaves Summary xsl report in qweb report 2015-02-04 15:28:50 +01:00