Commit Graph
49 Commits
Author SHA1 Message Date
Martin Trigaux fde3f4d4b9 [I18N] *: export 16.0 source terms
closes odoo/odoo#102163

X-original-commit: 011d7aac5aacedb3ab373f247471ba69d67f50f3
Related: odoo/enterprise#32288
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-10-06 14:56:52 +02:00
Leonardo Pavan Rocha 9d4f2624df [IMP] hr_work_entry_contract: convert calendar views to owl
Converts calendar views in hr_work_entry_contract to owl.

task-2992657

closes odoo/odoo#101657

X-original-commit: 9ffd5bba4b02df35fcd18908d21fa3bc95974f1e
Related: odoo/enterprise#32039
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-29 20:50:57 +02:00
Martin Trigaux 1a8772769e [I18N] *: export 16.0 source terms
closes odoo/odoo#100573

Related: odoo/enterprise#31507
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-20 13:48:49 +02:00
Yannick Tivisse 40d9249f90 [FIX] hr_work_entry_contract: Fix multi-company work entries generation
closes odoo/odoo#99760

X-original-commit: f32cb46f18a5ea28b39b29c3c7934656d6af72a0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-12 15:30:48 +02:00
Rob Coekaerts 252d7f4b39 [ADD] hr_homeworking: add homeworking information and features for employees
task-2700425
2022-09-02 13:29:15 +02:00
Yannick Tivisse c78bfc1463 [FIX] hr_work_entry_contract: Fix work entry generation cron
Purpose
=======

The cron is breaking (expected singleton error) if treating contracts
from the same company at the same time.

Actually, this shouldn't be done that way to avoid mixing unrelated
resource.calendar.leave.

Handle the contracts over 2 cron execution instead.
2022-09-02 13:21:40 +02:00
Rob Coekaerts 0a0ea0336b [IMP] hr_work_entry_contract: Add warning when regenerating work entries. 2022-09-02 13:21:40 +02:00
Rob Coekaerts 6ce0ec9cb2 [IMP] hr_work_entry_contract: Extend work entry generation period by one month.
As the hr_homeworking module will rely on hr_work_entry to designate the
homeworking location of employees, it is necessary that work entries are
generated further in advance than up until the end of the current month, so that
employees can indicate their homeworking locations a reasonable time in advance
(at least one month).
2022-09-02 13:21:40 +02:00
Yannick Tivisse d2ad74f8bd [IMP] hr_work_entry_contract: Allow regenerating work entries for several employees
closes odoo/odoo#98036

Taskid: 2917741
Related: odoo/upgrade#3772
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-16 09:19:20 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Dossogne Bertrand c5679f0e22 [IMP] hr_contract*: improve general usability
*:
hr_contract
hr_work_entry
hr_work_entry_contract

This commit changes several views and methods to improve general usability of the payroll application

TaskID #2783013

closes odoo/odoo#89311

Related: odoo/enterprise#26466
Related: odoo/upgrade#3534
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-29 12:19:03 +02:00
Martin Trigaux 5acb6db891 [I18N] *: export saas-15.4 source terms
closes odoo/odoo#93246

X-original-commit: 5ff6d185f70650c26c28a6aef7dd37c859ab58d2
Related: odoo/enterprise#28218
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-06-10 07:27:26 +02:00
Agustín Castro Bugallo 208c714b40 [FIX] hr_work_entry_contract: Fix is_unforeseen_is_leave constraint violation
The constraint is added in `hr_payroll`, checking that if `is_unforeseen`
is True, then so must be `is_leave`. To reproduce the error simply install
`hr_payroll`, edit Work Entry Type Attendance to set as unforeseen absence
and upgrade the module `hr_work_entry_contract`.

closes odoo/odoo#92358

X-original-commit: 5448ddcbec8a1058aa271206d5a8999b3e67dda5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-27 15:42:46 +02:00
William Braeckman 9985fd0725 [FIX] hr_work_entry_contract: fix generation of work entries
This commit aims to fix an issue with work entries generation when the
requested period is completely outside of the contracts period.
In this case no work entries should be generated.

Part-of: odoo/odoo#90933
2022-05-11 16:00:34 +02:00
William Braeckman f51afa1ed4 [IMP] hr_work_entry_contract: prep work for multiple sources
Prep work to allow work entries to be created from multiple sources when
using contracts.
The end goal is to be able to generate work entries from attendance as
well as the planning app.
After that the plan is to make sure the implementation works well with
payroll for hourly wages.

This commit contains the necessary changes for the next work_entry
modules to work.

TaskId-2466871
2022-05-11 11:23:04 +02:00
William Braeckman 3b1e37ce67 [FIX] hr_work_entry_contract: fix first batching
While investigating an error that occured on production it was noticed
that work entry batching did not happen correctly on the first batch for
contracts that started on the same date, this is due to the microseconds
being different in the `date_generated_from` and `date_generated_to`
fields.

TaskId-2466871
2022-05-10 14:56:10 +02:00
Yannick Tivisse e5e1f09ae7 [FIX] hr_work_entry_contract: Fix work entries generation
Coming from https://github.com/odoo/odoo/commit/0bac1d33a25e37ebece69de030b9fd72caa43a02

closes odoo/odoo#90670

X-original-commit: f2eb4f0fb4294b4548312a909a841744ee4a9734
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-05-06 13:30:15 +02:00
Victor Feyens 42bad1a6d2 [IMP] *: remove useless keys from manifests
Remove most values uselessly specified because giving the same value as 
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)

* auto_install is Falsy by default
* author is Odoo SA by default
* summary & description are empty strings by default
* application is False by default
* test, demo, depends and data are empty lists by default

This will reduce noise/inconsistencies between manifests specifications, 
simplify analysis of manifests content, ...

closes odoo/odoo#90209

Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-05-03 13:31:16 +02:00
William Braeckman 84d8bf8167 [FIX] hr_work_entry: fix multi calendar issue with global time off
When creating a global time off in one resource.calendar A , it will be
propagated on any new resource.calendar B.
However the reverse is not true, if I delete the global time off in
calendar A it will not be deleted in calendar B.
During the work entry generation this is not taken into account, a
contract using calendar A will generate leave work entries because of
the global time off in calendar B.
This is due to a change in PR odoo/enterprise#15091.

The domain is now correct and will only fetch the right leaves.

TaskId-2627378

closes odoo/odoo#88725

X-original-commit: 0bac1d33a25e37ebece69de030b9fd72caa43a02
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-04-13 20:42:46 +02:00
Yannick Tivisse 588be815e2 [FIX] hr_work_entry_contract: Batch calendar leave search
X-original-commit: b8166297fed24d4a7e13ebc37e670b670c2a2575
2022-03-30 17:04:49 +02:00
Yannick Tivisse 1ffc2eadc5 [FIX] hr_work_entry_contract: Batch attendances computation
X-original-commit: ad36598bca20d3f010c0e5a19aded8b619ad689d
2022-03-30 17:04:48 +02:00
Yannick Tivisse 4807ec389b [FIX] hr_work_entry: Compute work entries duration in batch
X-original-commit: ae165f48178d89ad1b74961c7d4829f1ff5ca0c4
2022-03-30 17:04:47 +02:00
Yannick Tivisse 53bacb11a6 [FIX] hr_work_entry_contract: Improve perf on _get_work_entries_values
Purpose
=======

Both list comprehensions are quite heavy (+- 20 seconds to generate
work entries for 1000 employees over 1 month), because they are O(n²)

X-original-commit: 21fb4786b329916cdabd0a49674d93179295cd32
2022-03-30 17:04:45 +02:00
Yannick Tivisse fffac54cd9 [FIX] hr_work_entry_contract: Disable tracking on work entries generation
Purpose
=======

Writing on untracked fields like date_generated_from will fetch allt he fields
values, including non stored ones (like wage_with_holidays, which is heavy).

X-original-commit: 5145e0782b4e3246ab84e81f4a7b450d7f463efe
2022-03-30 17:04:44 +02:00
Yannick Tivisse fc9e7b023f [FIX] hr_work_entry_contract: Batch generation dates adjustment
X-original-commit: 18b4395e1718a72700bfeefe7ba524e72c87bb04
2022-03-30 17:04:43 +02:00
Martin Trigaux 9fbf706ba8 [I18N] *: export saas-15.2 translations
closes odoo/odoo#84475

X-original-commit: 8ea2605fbfec6277d7a01b6e73548a9585866c61
Related: odoo/enterprise#24289
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-14 10:44:50 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
Yannick Tivisse 02b356cf82 [FW][FIX] hr_holidays: Improve error messages
closes odoo/odoo#83410

Forward-port-of: #83278
X-original-commit: db203ae7a6eee715fbc32939c5e38457cee7762a
Related: odoo/enterprise#23755
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-01-26 15:59:03 +00:00
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
William Braeckman ecddd5f729 [IMP] hr_*: Improve tests execution speed by using setUpClass
closes odoo/odoo#79063

Taskid: 2669222
Related: odoo/enterprise#21920
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-27 13:16:42 +00:00
William Braeckman 88f18b1ce9 [FIX] hr_work_entry_contract: fix traceback
Fixes a traceback when generating work entries.
How to reproduce:
- Create a contract with a working schedule with 0 attendances
- Set the contract as running
- Make sure you have another contract for another employee running on
  the same period, this one must have attendances
- Go to the work entries views, this should generate working entries for
  the viewable dates
- If the work entries were already generated, go to a month where they
  are not generated yet, you should have the traceback

Task ID: 2654797

closes odoo/odoo#77085

X-original-commit: 13f7f8c4e066b0a2fadef95cdff4a24a4f67f95c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
2021-09-23 19:04:45 +00:00
Yannick Tivisse f0d5c73c57 [IMP] hr_work_entry: Improve work entries generation perf
Purpose
=======

The work entries generation is not scaling properly
for large employee datasets. A lot of improvements
have been made to reduce the number of query to the
database. However, one of the remaining bottleneck
was the new records insertion, made 1 by 1 on the
database.

Due to the fact that the model doens't have a lot
of columns, and doens't have columns containing
too much data (HTML fields for example), we could
imagine inserting the records by batch, for example
1000 by 1000, as it is done with SELECT.

The results weren't satisfying enough, so we prefered
using the new cron triggers mechanism, to re-trigger
the same cron at the end of its execution in another
transaction, to avoid exceeding the non return point
from which posgreSQL is pedaling in the semoule.

With this commit, it takes less than 30 seconds to
generate the work entries for 1000 employees, instead
of 3 min, and allows to generate the work entries in
a linear execution time instead of a exponential one.

Create method analysis:
=======================

Note, that only the call to the create method is
tracked, not the preprocessing time to retrieve
the work entries values.

When inserting the records 1 by 1:
----------------------------------

records   - Elapsed Time (s)   - AVG Time per record (s)
10        - 0.0045862197875976 - 0.00045862197875976
432       - 0.1101946830749511 - 0.00025508028489572
192       - 0.0525383949279785 - 0.00027363747358322
522       - 0.1418645381927490 - 0.00027177114596312
892       - 0.2803149223327636 - 0.00031425439723404
8800      - 3.4928441047668457 - 0.00039691410281441
88000     - 188.82338452339172 - 0.00214572027867490
176000    - 1172.4313135147095 - 0.00666154155406084

We observe that from 10.000 new record, the create
method is not scaling anymore before this commit.

For a company with 1000 employees, the mean work
entries by month is 1000*2*21=42.000 work entries,
and the time to create the records is not acceptable.

When inserting the records 1000 by 1000
---------------------------------------

records   - Elapsed Time (s)   - AVG Time per record (s)
10        - 0.003406763076782  - 0.0003406763076782
432       - 0.075028181076049  - 0.0001736763450834
192       - 0.030718326568603  - 0.0001599912842114
522       - 0.084228038787841  - 0.0001613563961452
892       - 0.145947217941284  - 0.0001636179573332
8800      - 2.204506397247314  - 0.0002505120905962
88000     - 181.9736533164978  - 0.0020678824240511
176000    - 1146.928646564483  - 0.0065166400372981

We observe a sligh improvement, but cleary not enough
and not worth the complexity of inserting the records
in batch on the database.

Note: The following explanation is speculative and could
be validated with a real analysis, but according to the
results we obtained with the cron, this is most likely
to be true.

In fact, this is a limitation of PosgreSQL. In the
implementation that manages the transactions, the number
of inserts becomes greater than certain memory limits,
suddenly it falls on a slower alternative storage (this
is the problem with SELECT and tuples of ids ).

When we inject 100,000 ids into a query, PosgreSQL parses
the query (already there it could have some trouble), then
it stores the ids in a data structure: hash if not too
large, other (on the file system) otherwise. Then it
executes the query and uses the data structure to check
the validity (membership).

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

Instead of inserting the record in batch in the same
transaction, it would be more interesting to split the
transaction into several transactions:
Each transaction process N employees who have not yet been
processed, until there are no more. With the new cron
trigger mechanism, it is possible to:
- When the cron runs, it processes N employees
  (N to be determined)
- If there is still some, he retriggers itself at the end
  of his transaction
Like that, the cron is scheduled 1x / day, but it is
retriggered as many times as necessary each month.

Regarding the number of employees to process, with 100
employees, we can expect:

100 * 2 (morning / evening) * 21 (working days) = 4200

work entries to generate, which is manageable given
the above measures.

closes odoo/odoo#76488

Taskid: 2646056
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-16 10:00:54 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
254d6a71e8 [IMP] hr_holidays: Improve Accruals, dashboards and general UX (Back2basics)
Purpose
=======

Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.

- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
  Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
  for each employee.
  In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
  simple use case.  But in USA, it's possible to change the calculation mode each year.
  Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
  HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
  Improvement of global time off feature located on Working hours calendar. Now, Time off
  application have to manage Public Holidays.
- Review of Time Off type configuration

COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413

closes odoo/odoo#72511

Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2021-09-02 12:57:03 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Yannick Tivisse e91e6307e6 [IMP] hr_contract: Improve general UX (back2basics)
- hr_contract: Add kanban view on contract history action
- hr_contract: Display the avg wage, not the sum on aggregates
- hr_contract: Improve contract history list view
- hr_contract: Improve contract history tree view
- hr_contract: Improve contract history search view
- hr_contract: Display wage on contract kanban view
- hr_contract: Improve contract tree view
- hr_contract: Improve contract search view
- hr_contract: Make hr_responsible required
It is useful in multiple HR flows.
- hr_contract: Improve contract history form view
- hr_contract: Improve contract form view
- hr_work_entry: Improve work entry computed name
- hr_work_entry: Improve work entries tree view
- hr_work_entry: Improve work entry type form view

closes odoo/odoo#72402

Taskid: 2558171
Related: odoo/enterprise#19124
Related: odoo/upgrade#2583
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-28 14:39:44 +00:00
Yannick Tivisse 7880185883 [FIX] l10n_be_hr_payroll: Lower SQL requests on payslip computation
closes odoo/odoo#71151

Related: odoo/enterprise#18431
Related: odoo/upgrade#2471
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-26 11:34:36 +00:00
Yannick Tivisse f2d4ae20f1 [FIX] hr_work_entry_contract: Avoid traceback
closes odoo/odoo#71018

X-original-commit: 6f6d98f0318dabba4171125c4acf38e49d67c11b
Related: odoo/enterprise#18393
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-19 09:36:47 +00:00
Yannick Tivisse 11388ae492 [FIX] hr_payroll: Recompute work entries/payslips on contract update
closes odoo/odoo#70814

Forward-port-of: #18075
X-original-commit: ee398e1abe44caca8bab74f27614dabd9b45590e
Related: odoo/enterprise#18322
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-17 09:36:00 +00:00
Martin Trigaux 41d8b8cf68 [I18N] *: export saas-14.3 source terms
closes odoo/odoo#70673

X-original-commit: bcb9ff784e44462384b0a43a0a23eed7a1111bc5
Related: odoo/enterprise#18269
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-11 12:28:28 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Yannick Tivisse 98f86305b3 [IMP] hr_work_entry_contract: Lessen calls to _get_bypassing_work_entry_type
Allows to reduce the number of queries of 4*N, with N=number of contracts.

closes odoo/odoo#67471

Related: odoo/upgrade#2255
Related: odoo/enterprise#16842
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-10 14:25:22 +00:00
Yannick Tivisse d5abecbce5 [IMP] hr_work_entry_contract: Make _get_contract_work_entries work in batch
Purpose
=======

Reduce by N the number of calls to the method, with N = Number of payslips
2021-03-10 14:25:21 +00:00
Yannick Tivisse b57272794c [IMP] hr_work_entry_contract: Reduce _generate_work_entries queries 2021-03-10 14:25:21 +00:00
Arnaud Joset 793fe22f8a [IMP] hr_work_entry_contract,hr_work_entry_holidays: cleaning style
Before this commit, the imported module would trigger some runbot warnings.

taskid: 2222790
2021-02-26 08:42:24 +01:00
Arnaud Joset 7f126cec5d [IMP] hr_contract,hr_work_entry_contract: remove enterprise features
Before this commit, the hr_work_entry_contract contained enterprise views/features that could not be integrated in community.
These features are now provided by the hr_work_entry_contract_enterprise module.

taskid: 2222790
2021-02-26 08:42:24 +01:00
Arnaud Joset c6998b3b14 [MOV] hr_work_entry_contract: move to community.
Before this commit, the module dependencies: hr_contract and hr_work_entry were defined in community.
As they could be integrated with some community applications, like hr_attendance or hr_holidays, it is more coherent to move them to community.

Taskid: 2222790
2021-02-26 08:39:43 +01:00