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.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
It is not possible to define a working time that lasts a whole day. This
can lead to calculation errors.
To reproduce the error:
(Need mrp,hr_payroll)
1. In Settings, enable:
- Work Orders
2. Create a Work Center WC
- Working Hours: <Create and Edit>
- 2 shifts:
- Monday, From 0 To 24
- Tuesday, From 0 To 24
3. Create a routing R:
- Add an operation:
- Work Center: WC
- Default Duration: 1440 (i.e., 24h)
4. Create a Bills of Materials BM
- Routing: R
5. Create a MO:
- Bill of Material: BM
- Plan From: Next Monday
6. Save, Mark as ToDo, Plan
Error: Since the operation should last 24 hours, the end time should be
the same. However, the Planned Date field is incorrect: the end time is
one minute too late. This error is even more noticeable when increasing
the quantity to be produced.
On step 2, when setting the 'Work to' field to 24, it automatically
becomes 23:59. The first consequence is directly observable on working
time form: we should have a total of 48 hours/week but the current total
is 47.98 hours/week. Another consequence is the end of the planned date
(as described above).
OPW-2462094
closesodoo/odoo#72210
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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>
Purpose
=======
In Belgium, the job market is divided into "sectors": chemicals, metals, banks,
department stores, pharmacies ... This breakdown is made on the basis of the
activities of the company. In order to be able to ensure the functioning of the
sectors, each sector has its own consultation body, called the "joint commission".
A joint committee is a consultation body in which representatives of employers
and unions set, after negotiation, the minimum wage conditions as well as the
working conditions in legal texts, called “collective labor agreements”. These
are applicable to all employees in a specific sector.
These are agreements that employers and workers in a given sector must make and
respect. These agreements may be different from one sector to another. Each sector
has its label and number.
The CP 200 is the auxiliary joint committee of employees (CPAE). About a quarter
of private sector companies and employees in Belgium are found in CP 200. This
makes it the largest and most diverse CP in the country!
TaskID: 2352568
Specification
=============
Most of the different use cases that we can face in belgian payroll for CP200
have been tested and validated by a fiscal expert. Briefly, it covers the following
use cases:
- Unpaid time off
- Legal time off
- Credit time
- Classical
- With paid time off
- With unpaid time off
- With sick time off
- Starting in the middle of a month
- Full time (O hours / week)
- Half-days in working hours
- Classical
- With full-day time off
- With half-day time off
- Low salaries
- Back-to-work - Sick time off
- Relapse
- Guaranteed salary
- Long sick off (+1 month)
- Student contracts
- Posted Employess
- Without ONSS
- Wihtout withholding taxes
- Public Holiday
- Classical (during the working hours)
- Compensation (during the week end)
- After the end of the contract
- Note: Variable compensation is not handled yet, but it's planned
- Brief Holiday (In french: "Petit Chômage")
- 1 day
- 1 week
- Note: Variable compensation is not handled yet, but it's planned
- 1 day for unpredictable reason
- End of contract in the middle of the month
- Half-days time off
- New design of the payslip to improve readability
The detailed list of the fixes/improvements is the following:
- 1/ hr_work_entry_contract: Define 1 leave work entry per presence
Purpose:
Some sick time off have to be defined into different work entry types, according
to the type of sick leaves.
Example: after 30 calendar days of sick leaves, the employee is not paid by the
same organism and therefore, the time off should be reported into different work
entry types.
Specification:
Instead of creating a big work entry per time off, create as many work entries
as there should have been presence work entries.
- 2/ hr_work_entries: Prevent users deleting work entries
Prefer to archive them instead.
- 3/ hr_work_entry: Display work entry type on calendar views
- 4/ web: Add styling classes for report
Purpose:
Those classes are useful for the payslip printed pdf reports, but some
of them are useless for any kind of report, and thus the classes have
been defined in the web addons.
Task-2341886
- 5/ resources: Take company attendances/global leaves on creation
Purpose:
When creating a new calendar (38 hours/week) on a Belgian company,
the new calendar is prefilled on a 40 hours/week basis, even if the
company calendar is correctly defined.
Specification:
Copy the global time off + the attendances on the company calendar
on company modification
- 6/ hr_holidays: Allow to refuse overlapping time offs
Purpose:
It's normally not possible to create 2 time off that overlaps on the
same period.
But, if for a given reason it happens on a production database, it should
be possible to refuse those time off. Otherwise, the user is stuck with
this wrong configuration.
- 7/ hr_holidays: Prevent creating time off of 0 hours
Purpose:
It makes no sense + it could cause conflicts when generating the work
entries
- 8/ resource: Add method to retrieve the longest work day
Purpose:
Add a method on the calendar to retrieve the maximum number of hours
an employee is supposed to work.
Example:
Monday: 8-12, 13-17
Tuesday: 8-12, 13-17
Wednesday: 8-12
Thurday: Off
Friday: Off
The method will return 8
- 9/ hr_holidays: Adapt query counter due to changes on hr_payroll
See: https://github.com/odoo/enterprise/pull/13848/
- 10/ hr_payroll: Update translations
Lots of new terms have been added on the printed reports, etc...
- 11/ l10n_be_hr_payroll: Consider out of contract public holiday
Purpose:
If there is a public holiday less than 30 days after the end of the
contract, the employee should be paid for that day too
- 12/ l10n_be_hr_payroll_posted_employee: Add an easy way to create a public time off
Purpose:
Public time off should be created via the calendar (at least for belgian companies using payroll).
The reason behind this is that there should be a resource.calendar.leaves available even if the
employee ends its contract. If it's created using a hr.leave, there won't be any
resource.calendar.leave as the employee is not supposed to work anymore at that time.
When an employee leaves the company, it's possible that he's paid for public time off if it
occurs less than 30 days after the end of his contract.
- 13/ l10n_be_hr_payroll: Rename bank holiday into Public holiday
Purpose:
A bank holiday is a specific holiday name, not the generic one.
- 14/ hr_work_entry_contract: Add menuitem to access calendars
It shouldn't be required to enter debug mode to access this information.
- 15/ l10n_be_hr_payroll_posted_employee: Add support for posted employees
Purpose:
https://www.socialsecurity.be/citizen/fr/travailleur-salarie-occupe-en-belgique-detache-a-l-etranger
- 16/ l10n_be_hr_payroll: Implement guaranteed wage/relapse for sick leaves
Purpose:
Guaranteed salary for employees:
The employee who is incapacitated for work as a result of a work accident, an accident on
the way to work or an occupational disease retains, at the employer's expense, the right to
his remuneration for the first 30 days of incapacity for work. The daily allowances relating
to this period are paid to the employer by the body responsible for industrial accidents or
by the Fund for Occupational Diseases.
Successive disabilities - relapse:
It is possible that a worker will be unable to work during different successive periods.
When two incapacities follow one another without interruption (for example, accident followed by
illness; successive illnesses of a different nature), there is only one period of incapacity and
the guaranteed remuneration is not due again. time.
On the other hand, we talk about relapse when a new disability occurs after the worker has returned
to work normally.
In this case, the guaranteed remuneration is not due again when the new incapacity for work occurs
within the first 14 days following the end of a period of incapacity for work giving rise to the
payment of the guaranteed remuneration.
However, there is still a right to the guaranteed salary for the part remaining to run, if the first
period of incapacity has not exhausted the entire right to the guaranteed salary during the first
period of incapacity. A new guaranteed wage is also due again when the worker establishes by a
medical certificate that this new incapacity for work is due to another illness or to another
accident.
- 17/ hr_work_entry_contract: Define 1 leave work entry per presence
Purpose:
Some sick time off have to be defined into different work entry types, according
to the type of sick leaves.
Example: after 30 calendar days of sick leaves, the employee is not paid by the
same organism and therefore, the time off should be reported into different work
entry types.
Specification:
Instead of creating a big work entry per time off, create as many work entries
as there should have been presence work entries.
- 18/ test_l10n_be_hr_payroll: Add test for full time credit time
- 19/ test_l10n_be_hr_payroll: Add test for out of contract credit time
- 20/ test_l10n_be_hr_payroll: Avoid undeterministic bug on generated tests
- 21/ hr_payroll: Don't display out of contract line on pdf
- 22/ test_l10n_be_hr_payroll: Fix undeterministic test crashes
- 23/ payroll : Improve the printed payslip report
Improves the design of the payslip report
Generates the report in the employee's language (add a message if the lang is not official)
Adds some data to Laurie Poiret
Task-2341886
- 24/ test_l10n_be_hr_payroll_account: Add test for unjustified reasons
- 25/ test_l10n_be_hr_payroll_account: Add tests for small unemployment
- 26/ test_l10n_be_hr_payroll_account: Add tests for half days time off
- 27/ test_l10n_be_hr_payroll_account: Fix false positive
- 28/ hr_holidays: Prevent creating time off of 0 hours
Purpose:
It makes no sense + it could cause conflicts when generating the work
entries
- 29/ test_l10n_be_hr_payroll_account: Add test for end of contract
- 30/ test_l10n_be_hr_payroll_account: Add tests for public holidays
- 31/ hr_payroll: Display amount if hourly wage
- 32/ hr_work_entry_contract: Allow creating record on gantt view
- 33/ l10n_be_hr_payroll: Add new structure for student employees
Purpose:
Also bring some fixes on fields display + hours/days counts
TaskID: 2347843
- 34/ test_l10n_be_hr_payroll_account: Add test for low salaries
Ensure the correct computation of the employment bonus.
- 35/ l10n_be_hr_payroll: Make separate lines for half/full worked days
Purpose:
Worked days should be separated between the complete full days and the
half days.
Example:
I work on Monday, Tuesday, Wednesday (half day)
The calculation is OK, but the number of days is, in principle, 14 in the month of
September 2020 (9 full and 5 in half-days). This number of days should be the subject
of 2 separate lines:
9 days - 68.4 hours - € 1,100.77
5 days (in the form of half-days) - 19 hours - 224.33 €.
In this case, we cannot use the hourly formula since the monthly salary must always be
the same, without having an identical number of working days.
The worker benefits from 14 meal vouchers. The number of days must however correspond
to the number of meal vouchers so that the worker can check.
- 36/ test_l10n_be_hr_payroll: Test credit time with sick leaves
- 37/ test_l10n_be_hr_payroll_account: Test credit time with unpaid leaves
- 38/ l10n_be_hr_payroll: Don't consider time off as credit times
Purpose:
When generating the work entries, we compare the standard attendances
(i.e. the full time contract) and the credit time attendances to
deduct the intervals on which the employee is on credit time.
But if the employee is on a time off during a period, those intervals
will be removed from the supposed attendances, and then those periods
are considered as credit time.
- 39/ l10n_be_hr_payroll: Fix credit time amount on payslip computation
Purpose:
The time credit days must not include a corresponding amount.
In fact, no remuneration is linked to the taking of time credits. The necessary modifications
are:
Code LEAVE300 -> no amount
- 40/ hr_payroll: Export standard calendar if needed on payslip export
- 41/ l10n_be_hr_payroll: Fix worked days lines amount computation
Purpose:
The amount was computed as a simple ratio based on the number of days.
To be correct and compliant with the law, we should consider the hourly
equivalent wage, and compute the amount based on the worked hours.
- 42/ l10n_be_hr_payroll: Fix unpaid worked days amount computation
Purpose:
Don't use the normal wage which is an integer btw.
Compute the worked days amount using the classic hourly computation formula
- 43/ l10n_be_hr_payroll: Fix unpaid leaves retenues formula
Purpose:
Unpaid leave must be deducted from the usual gross monthly salary
up to the number of working hours concerned.
The formula is in principle the following:
gross monthly salary * 3/12/38 -> “usual” hourly salary.
So, in the case of 2 days of unpaid leave, corresponding to 15.2 hours,
the formula is as follows: 2650 * 3/13/38 * 15.2 = 244.61 €.
The gross for the days actually worked is € 2,650 - € 244.61, or € 2,405.39
- 44/ hr_payroll: Generate python test from arbitrary payslip
When the payroll is incorrect, the feedback that we receive is
generally: "this doesn't work".
This commit add a route in the controller of hr_payroll, to export
in a python file, all data useful to reproduce the exact employee
situation about the incorrect payslip.
Before testing and fixing the incorrect payslip, we need to anonymize all
sensitive data about the employee. This commit converts all sensitive
data into demo data.
This commit add a button in payslip form view to use the new route to
export all data about the incorrect payroll.
This button is only displayed when we are in debug mode and the current
user is a payroll manager.
task-2337786
closesodoo/odoo#60136
X-original-commit: 60eaecb749ad68429e4d8ba00ff0200c3360cdcb
Related: odoo/enterprise#14147
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Including demo data this time
closesodoo/odoo#58862
X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Mainly transifex issues but also some errors found through 'grep' checks.
Fix typos and obscure english strings in xml contents, fields strings/helps, some docstrings, ...
ensuring correct translations base (and fallback when translations isn't available).
closesodoo/odoo#57276
X-original-commit: 4214f05d454bca2b60fda3a288d529c098e84f77
Related: odoo/enterprise#13053
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Before this commit, when two week calendar were used, the tooltip was wrongfully assuming which week were odd and even.
Even with correct information, it was not easy to fill and could easily lead to wrong information on the payroll.
closesodoo/odoo#56055
Taskid: 2308804
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
TL;DR
=====
Improve performances with nearly a factor of 2. Use case, call action_validate on hr.leave for 100 employees
- 1987 requests -> 844 requests
- 1300 ms -> 700 ms
Purpose
=======
The first purpose of this commit is to add a test ensuring the number of request while creating
a company leave for 100 employees, if 15 of them already have a leave during that period.
It includes, the mass leave generation, and the conflicts resolutions. (Cancelling/Splitting the
already existing one and adapting the dates accordingly).
The second one is to reduce the number of request for this test.
In term of requests, currently we have:
- 5154 requests without bypassing the mail tracking + the activities management
- 1987 requests when bypassing the mail post-process (this is the current value, the bypassing was
already done several month ago)
- 844 requests with all the optimization done in resource/calendar/hr_holidays
In terms of execution time, we have a reduction from +- 1300 ms to call the method action_validate
to +- 700 ms
As the performances issues severity increases with the number of leaves to create and the real time access
to the database, on the production base, we reduced the execution time to generate more than 500 hr.leaves
from several minutes to 21 seconds. A fix to avoid deadlock was already made at
https://github.com/odoo/enterprise/pull/10740/files
Some contortions were made to avoid changing a signature method in a stable release and thus
introducing for each method a second one, with the "batched" implementation, to keep a retro-compatibility
for the existing custom code.
But surely this could be cleaned in the master version. The old one will be deprecated while waiting to be
removed in a few versions.
closesodoo/odoo#56534
Taskid: 2256705
X-original-commit: 8c96a887d3f05680c923dcd44f9c70c0e5e0bd32
Related: odoo/enterprise#12670
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The method `_get_unavailable_intervals` was only available on
`resource.resource`. It's now moved to the `resource.calendar`.
closesodoo/odoo#51311
Taskid: 2253893
Related: odoo/enterprise#10616
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit sets the fields date_from and date_to as optional hidden on
the resource.calendar.attendace.
closesodoo/odoo#51527
Taskid: 2241686
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
With a user with timezone "Europe/Brussels", add a
slot on the gantt view where the preceding day is a working day.
The default starting time will be the previous day.
Reason: the default starting time is midnight, adjusted to
the closest attendance interval in the employee's calendar.
However, midnight in "Europe/Brussels" is actually 10pm UTC
the previous day.
The method adjusting the datetime to the closest attendance only
checks within the corresponding day.
Two ways to fix this:
1) the business code calling `_adjust_to_calendar` should
timezone the datetimes itself. To avoid similar bugs in the future,
the method should be modified to only accept timezoned datetimes.
2) Change `_adjust_to_calendar` to convert datetimes it was given
to the resource's timezone and consider the dates in those converted
datetimes.
Option 2 is chosen because it seems to take care of the problem at a lower
level which allows the business code to not think about those timezone details.
While this is technically an API change (in a stable release), the method was
introduced recently by b058ca1 as a fix for an already broken method.
closesodoo/odoo#53582
X-original-commit: c6cecac60360a1d8b0c62ee155a818a3a28505e1
Related: odoo/enterprise#11399
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))
Old syntax is still compatible but starts the migration to the new
syntax that catches error.
The methods `get_work_hours_count` and `_attendance_intervals`
raise a traceback if `self` does not contain a single calendar record.
This commit adds an explicit check for this requirement.
Related PR odoo/enterprise#10593closesodoo/odoo#51326
X-original-commit: e5d93be382b03c7a9c925b4a2e6be6875843195d
Related: odoo/enterprise#10619
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, It was not possible to Hide Working Time or Deleting Working Time if Resource is linked to it.
Now we add, Active field to Hide Working timw without removing it.
closesodoo/odoo#50963
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The method `_get_work_interval` has several problems:
1) The name is not self explanatory in any way
2) It should be defined on the `resource.mixin`
3) It simply does not work (as described in its docstring).
Here is a simplified example (only concerned about hours):
Currently, given two attendances: 8-12 and 13-17,
with parameters start=9 and end=18 it returns (9, 17)
while it should return (8, 17).
This leads to strange behaviors in the planning app:
Given employee A with calendar 8-17 and employee B 8-16.
Create a planning slot and assign employee A: the start and end times
are set to 8-17.
Then assign employee B, the start and end times are correcly set to 8-16.
Now reassign employee A: the start and end times are not set to 8-17.
Task 2229296
closesodoo/odoo#50804
X-original-commit: 7dfab89bc0025cf6424f00b6992fef1f42463ffe
Related: odoo/enterprise#10426
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
In a calendar with 2 weeks mode (odd and even), before this commit, all
new created periods (placed in one of the two sections) don't have the
week_type field set. This generates a confusion, because a period that
should be applied only in odd weeks, for instance, it was applied also
in the even weeks.
Now, the new periods will have the week_type field set with the
week_type of the section where is it. Also, an error message is raised
if a period is not in one of the two sections.
opw-2239966
closesodoo/odoo#50478
X-original-commit: 33a62118818952872321591e85403b657380128a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Purpose
=======
When duplicating a calendar, duplicate their global time off too.
closesodoo/odoo#49255
Taskid: 2230549
X-original-commit: b1417a8f094331246120ce5f0a5d25db6c6eb8a7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
ir.rule are default values but can be customized based on the
company's policy and needs.
This is typically a record that is in noupdate as should be
customization-friendly.
Currently, to activate/deactivate records with the 'active' checkbox
user has to switch to edit mode of the form.
So the purpose of the task is to allow the user to activate/deactivate
records from the readonly mode of the form view.
In this commit, we set widget='boolean_toggle' on the 'active' field in form
view.
closesodoo/odoo#46567
Taskid: 2206794
Related: https://github.com/odoo/enterprise/pull/8918
Related: odoo/enterprise#8918
Closes: #46567
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When a contract is closed, set the date of the day.
In the contract cron, ensure that all closed contracts have
an end date if it is followed by a new contract.
Add multi-edit on work_entry list
closesodoo/odoo#44118
Taskid: 2180263
X-original-commit: 0b5d8ce756eac904a040ca700f44ea860daefcb4
Related: odoo/enterprise#7991
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía
closesodoo/odoo#41624
X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Move and adapt gantt unavailability related methods (
_get_work_interval() and _get_unavailable_intervals() ) from
hr.employee to resource.resource. This move allows the unavailability
to be generated for users without related employees (like in FSM in
enterprise).
Task-2069861
closesodoo/odoo#36785
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...
64px is close enough to 128px that it can be removed without a big impact on
download size.
It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.
The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.
If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.
Views
=====
- remove width and height attributes when existing CSS rules are overriding them
(eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules
task-2060865
closesodoo/odoo#36147
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>