Commit Graph
84 Commits
Author SHA1 Message Date
Swapnesh Shah 59bfef4c27 [Fix] hr_holidays: do not copy parent_id
When creating an allocation by employee tag if you copied any allocation
made, it was still linked to the parent allocation, hence when
confirming/refusing the parent allocation it would confirm/refuse the
copied one too.

Closes: #25106
2018-06-07 17:02:09 +02:00
RomainLibert 6de803645e [FIX] hr_holidays: remove duplicate onchange
There were two onchange methods on employee_id in hr.holiday.
2018-05-15 12:27:19 +02:00
Christophe Simonis 3ab25b60bc [MERGE] forward port branch saas-15 up to cae950e826 2018-04-23 17:59:59 +02:00
Christophe Simonis ab95e3c1f3 [MERGE] forward port branch saas-14 up to 9f88e1f51b 2018-04-20 17:25:08 +02:00
Christophe Simonis 9f88e1f51b [MERGE] forward port branch 10.0 up to b16c4f50d4 2018-04-20 17:22:42 +02:00
Akim Juillerat 4d88e8e822 [FIX] hr_holidays: update _check_holidays constrains
It was possible to edit a leave request in order to use a leave type
which had no more days left. This was due to a missing field in the
constrains call.

Closes #24320
2018-04-20 14:13:51 +02:00
Denis Ledoux 43f0cbcc86 [FIX] hr_holidays: employee onchange when no employee set
When changing the employee to None in an allocation,
this onchange raised an error because it attempted
to set an employee browser record (empty but still)
in a department many2one.

- Create a new leave allocation
- Try to change the field Mode (holiday_type) from "By Employee" to "By Employee Tag"

Fixes #23345
opw-1820069
2018-03-07 15:52:16 +01:00
Christophe Simonis bd16df15ea [MERGE] forward port branch saas-16 up to 98d01e46e5 2018-02-20 11:53:06 +01:00
tbe-odoo 825180867a [FIX] hr_holidays: Remove related on employee's department
- In SaaS-16 we have added a related on the employee's department.
    This causes access rights issues when changing the employee's department.
    We do not want to rewrite all the old records, only the new ones should use the new employee's department.
2018-02-19 10:39:04 +01:00
Christophe Simonis 72508cc241 [MERGE] forward port branch saas-16 up to 7792755946 2018-02-14 18:26:57 +01:00
tbe-odoo c6a3e034dd [FIX] hr_holidays: Remove related on employee's manager
- In SaaS-16 we have added a related on the employee's manager as the manager of the leave.
    This cause access rights issues when changing the employee's manager.
    We do not want to rewrite all the old records, only the new ones should use the new manager.
2018-02-14 13:18:17 +01:00
Jérome Maes d9cece2ef8 [IMP] project_timesheet_holidays: ease leave type configuration
A leave type now generate timesheet by default. So
the internal project/task are taken from the leave
type company (a default value for the company has
been added).
To allow the hr leave manager to select a project,
he should be alble to read the analytic account
(otherwise, crash when calling name_get).

Setting the default internal project/task is advanced,
so hidden in debug mode on timesheet config.
2017-09-13 08:41:31 +02:00
Dipali Tank 37fac4c548 [IMP] hr_holidays: relabel 'holidays' to 'leaves' as this is the App name 2017-07-17 12:20:48 +02:00
Christophe Simonis ab02bf34b0 [MERGE] forward port branch saas-16 up to cc38b93ab2 2017-06-09 17:11:47 +02:00
Christophe Simonis cc38b93ab2 [MERGE] forward port branch saas-15 up to 49f819a7a7 2017-06-09 16:43:27 +02:00
Denis Vermylen c0f81be335 [FIX] hr_holidays: add short name_get possibility
it will be used for the gantt view in enterprise
2017-06-07 14:36:25 +02:00
Nicolas Martinelli ef17f92c9f [FIX] hr_holidays: leaves left
The stat button "Leaves Left" is a computed field of type integer.
However, it aggregates the data of `number_of_days`, which is a float.
Since the field is not stored, we can change its type.

opw-743153
2017-05-30 17:05:16 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Adrien Peiffer (ACSONE) 3ea3be6374 [IMP] hr_holidays: move security check in separated method.
Closes #16792
Closes #16491
opw-740246
2017-05-08 15:13:58 +02:00
Jérome Maes 30384249e1 [ADD] project_timesheet_holidays: generate timesheet when on leaves
This commit proposes to allow to automatically generate timesheet lines
when an employee is on leaves. Project and task used for timesheeting
is globally configured on the company. Holidays type choose whether to
generate timesheets or not and take the company default configuration.

When an HR officer validates a leave request, analytic lines will be
generated for each day off. The unit amount will be based on the working
calendar of the employee taking the leave. Generated timesheet lines are
attached to the project and task configured on the holidays type.

Configuring timesheet lines generation at holiday type level allows to
tune the use of leave requests. You may have for example "home working"
holiday type that should not generate timesheets while "legal leaves"
should.
2017-05-03 10:15:27 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Géry Debongnie 54a90ca919 [FIX] hr_holidays,web: proper use of toggle_boolean in list view
hr_holiday was the only module that used a widget=toggle_boolean on a
button in a list view.  That behaviour was implemented as a column
widget in the previous list view, and was not reimplemented in the new
views. The feature is useful, but this was not done properly: it is
better to use a widget on a field (that was the intent) instead of doing
a weird hack like it was done.

With this commit, we update hr_holidays to use the ToggleBoolean widget,
which is supposed to work on every views.

Also, we fix the toggleboolean widget (it was not properly rendering
tooltips, and changes were not saved in readonly list view).

Note that it as the side effect of being better from the point of rpcs:
before, the list view had to reload itself.  Also, another advantage is
that models do not need to implement custom methods (such as
toggle_payslip_status) just to toggle a boolean...
2017-04-24 11:02:12 +02:00
Christophe Simonis 39ab200cd3 [MERGE] forward port branch saas-15 up to 780064ea89 2017-04-18 18:37:24 +02:00
Christophe Simonis 6c02d0de41 [MERGE] forward port branch saas-14 up to 2b3a5c8ec8 2017-04-18 18:16:13 +02:00
Christophe Simonis 2b3a5c8ec8 [MERGE] forward port branch 10.0 up to 72b7eb7e6e 2017-04-18 17:59:08 +02:00
Adrien Peiffer (ACSONE) f160bba4d1 [IMP] hr_holidays: improve inheritance
Improve inheritance on allocation creation by employee's tag.

opw-728620
Closes #16402
2017-04-18 12:52:46 +02:00
Adrien Peiffer (ACSONE) a055d5f226 [IMP] hr_holidays : add possibility of inheritance for meeting preparation values
Closes #16438
Closes #16432
2017-04-18 11:31:19 +02:00
Martin Trigaux 2382520c34 [IMP] odoofication 2017-03-30 08:59:13 +02:00
Christophe Simonis fb2504b24c [MERGE] forward port branch saas-15 up to aebd043662 2017-03-28 18:38:49 +02:00
Christophe Simonis 2df5faa551 [MERGE] forward port branch saas-14 up to 2f68e9e93a 2017-03-28 18:05:31 +02:00
Christophe Simonis 2f68e9e93a [MERGE] forward port branch 10.0 up to 72fa3e8bda 2017-03-28 17:27:19 +02:00
Nicolas Martinelli 0dbc8b0e58 [FIX] hr_holidays: compute number of days
- Create a user with only "Employee" as only right
- Create a leave

An access error occurs.

opw-726049
2017-03-28 14:41:36 +02:00
Martin Trigaux b3934619d4 [FIX] hr_holidays: allow overlapping leaves and allocations request
The allocation requests have date fields that are only informative.
Having an allocation request (e.g. specifying dates of a public holiday)
overlapping the dates of a request is actually fine (if an employee is sick
during a public holidays, he can still use it for a leave request).

Closes #11026
2017-03-24 12:09:17 +01:00
Yannick Tivisse d0fbe51aa0 [IMP] hr_holidays: Clarify the value of manager_id
Currently the manager fields have this meaning:

 * manager_id: employee that approved the leave first;
 * manager_id2: employee that approved the leave secondly;

It makes no sense. Furthermore, on the Leaves Dashboard, when you group
by Manager, you group by first approver, which is also a nonsense.

This commit improves the behavior

 * rename manager_id and manager_id2 into first_approver_id and
   second_approver_id in order to understand their meaning
 * add a stored related field manager_id, readonly to avoid modifications
   on the employee
 * modify the views to only display the real employee manager, the other
   values are not valuable on the views
 * in code regularly a manager variable is used but is actually the
   current employee; a renaming is then applied
2017-03-14 15:25:16 +01:00
Thibault Delavallée 8ef89c317e [LINT] hr_holidays: remove unused import and unnecessary line breaks 2017-03-14 15:25:16 +01:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Thibault Delavallée bc067dfd8b [REF] hr_holidays: improve resource integration and remove product strange dependency 2017-02-27 14:04:48 +01:00
Thibault Delavallée 9d092c77c9 [REF] hr: remove inherit from employee on resource and use resource mixin 2017-02-27 14:04:48 +01:00
Thibault Delavallée be01aaa99f [REF] resource: remove deprecated compatibility and rename methods
Old methods are still present since a long time and are deprecated since
saas-3. This compatibility layer adds unnecessary complexity to the module
API. Those methods should now be removed. Some renaming is also performed
to ease resource api understanding, notably to better differentiate
internal methods from other methods.

All addons are updated accordingly.
2017-02-27 14:04:48 +01:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Denis Vermylen 0a989d6532 [FIX] hr_holidays: fix refusing multiple leaves
wrong use of self in loop, should've been holiday.
2017-02-17 14:12:53 +01:00
Christophe Simonis a282d4ae7f [MERGE] forward port branch saas-14 up to be9dfb331f 2017-02-10 18:41:06 +01:00
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Martin Trigaux cedb87165d [IFX] hr_holidays: translate holiday label
The display label (e.g. "Legal leaves (5 remaining out of 20)") was not
translatable.
Add the 'remaining out of' as translatable.

Replaces and closes #15212
2017-01-26 15:14:42 +01:00
Christophe Simonis fded0065ae [MERGE] forward port branch saas-14 up to 6c4389df41 2017-01-23 14:51:11 +01:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Nicolas Martinelli a93632df91 [FIX] hr_holidays: allocation name
When creating an allocation request by employee tag, the name contains
'False on...'.

opw-703893
2017-01-12 15:16:30 +01:00
hza 8b7aa82265 [IMP] hr_holidays: better distinguish allocation and leave requests
Purpose of this commit is to help user distinguish allocation and leave
requests. This is achieved through three improvements

 * name_get is improved to display the holidays type
 * type is tracked and therefore displayed in chatter messages
 * button in notification emails depends on holidays type
2017-01-09 11:05:05 +01:00
Christophe Simonis ca475e08eb [MERGE] forward port branch 10.0 up to 799e7f7740 2017-01-04 19:43:24 +01:00
Goffin Simon da54837420 [FIX] hr_holidays: "Absent Today" filter for normal users
Normal users has the rights to use the "Absent Today" filter.

opw:703389
2017-01-04 09:50:11 +01:00