Steps :
- Install Planning
- Users > Mitchell Admin > Preferences > Timezone :
Europe/Brussels
- Settings > Employees > Company Working Hours > Timezone :
Japan
- Planning > Gantt View > Week > Mitchell Admin x Friday > Click "+" button
Issue :
- Start date is set by default to Thursday 05:00
whereas it is expected to be set on Friday 00:00
Cause :
- When we want to plan a shift on a day,
we look into the 00:00 to 23:59 range for this day in calendar's tz
to get the closest work time inside of it.
- Yet, this doesn't take the "resource user" into account.
Fix :
- Set these limits for the day in resource's tz.
opw-2678221
closesodoo/odoo#82555
X-original-commit: 1b248ebd58e0a57b070ebf7d67c6da78351a720a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit adds methods to easily obtain calendar validity per resource
for a given search period and get the work intervals per resource,
taking into account the validity of their calendars.
In hr, the create and departure date of an employee are taken into
account to compute the calendars validity.
In hr_contract, it looks for every contract of human resources with
employee of type student or employee existing in the search period and
consider the specific calendar of the contract as valid during the
contract-lifetime.
PR: #77362
task-2646630
The False key is always added in attendance and leave intervals batch
but is not added in the work_intervals batch.
To give a more smooth API, this commit aligns work_intervals behavior
with the two other methods behavior, regarding the added False key.
Furthermore, we avoid to deal with a resource_list of two empty
recordsets, in the case where the resources parameter is None or empty
recordset.
PR: #77362
task-2646630
Purpose of this commit to improve generic UX for the project app.
So, In this commit done following changes:
- add 'subtask_effective_hours' and 'total_hours_spent' fields in the page of
subtask in task form view.
- change invisible attrs to column_invisible attrs for block_by page in task
form view.
- add 'task in progress' subtype for project.task and move 'stage changed'
subtype above 'task blocked'.
- remove the 'is_close' field and all its references from project.task.type.
- unarchive all of its tasks when the user unarchives the task stage.
- sort projects on 'is_favorite'.
- internal users following the project automatically follow its updates and
their notification preferences propagated accordingly.
- duplicating a task will duplicate all of its subtasks.
- move parent task field in extra info page of task form view.
- change the label of 'edit' to 'view' in the burger menu of project kanban view.
- user can delete task without sale_order validation error.
- add constraints for 'seller_ids' field.
- add remaining_hours_so field in task tree view.
- add unusual_days in task calendar view.
- add 'no content helper' in action of burndown chart.
task-2536044
closesodoo/odoo#74018
Related: odoo/enterprise#19880
Related: odoo/upgrade#2801
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Co-authored-by: Kartik Chavda <kcv@odoo.com>
Allow to use _adjust_to_calendar with or without leaves.
This PR adds a keyword argument to the _adjust_to_calendar, _get_closest_work_time and _work_intervals_batch to include or not the employee being on leave when searching for the start and end of the shift.
task-2632775
closesodoo/odoo#79127
Related: odoo/enterprise#21944
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
The end datetime is not timezoned in _adjust_to_calendar before defining the search_range and using the _get_closest_work_time method.
Since _get_closest_work_time will timezone the timestamp received to start searching, the search interval needs to refer to the same end timestamp to avoid erratic behaviors.
Task-2628876
closesodoo/odoo#79049
X-original-commit: cbf0cb6e210959b3ceea554ec68957416a125141
Related: odoo/enterprise#21915
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Improves on _attendance_intervals_batch to profit more from batching.
Resources are grouped by timezone since we know they will all have the
same result except for when there are resource assigned attendances.
Those have to be handled separately but are incoroporated in the same
routine.
TaskId-2674527
closesodoo/odoo#78741
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
If no timezone is given to _attendance_intervals_batch, the timezone was
overwritten by the first resource's timezone.
TaskId-2674527
Part-of: odoo/odoo#78741
Assign a search_range for calendar_end in the _adjust_to_calendar method in all conditions.
The search_range was only assigned a value if the start and end are on the same date before.
The _adjust_to_calendar method receives a start and end from midnight to midnight in the resource timezone.
Start and end datetimes can be set on a different day via the Gantt view set in month or year for example.
This commit ensures that a search_range is always assigned to find the calendar_end and not only when start and end are on the same day.
This allows to find the end of a shift searched over two days if the employee is only working one day.
Task-2628876
closesodoo/odoo#78746
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to reproduce:
Open the gantt view and add a few shifts for different resources
Observed behavior:
https://nimb.ws/1t38Jl resources are not sorted by alphabetical order
Expected behavior:
https://nimb.ws/NqIAG3 resources should be sorted by alphabetical order
task-2633936
closesodoo/odoo#76621
X-original-commit: 9c4ed2bcadc417a2927877902c4c275e5d9d16d5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
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
closesodoo/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>
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.