The employment type and first contract date were made available on the
public employee, however those fields but don't need to be publicly
available.
odoo/upgrade#4539
task-3252610
closesodoo/odoo#118333
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This reverts commit 94bbffe46b introduced
in #109904.
This change was bringing more issues than it was trying to solve.
task-3254874
Part-of: odoo/odoo#117663
Steps to reproduce:
Launch a contract which has an end date
scheduled for the next day for an employee
and manually activate the "HR Contract: update state" cron.
Issue:
Running contracts are closed one day in advance.
Solution:
Correct the condition which selects contracts to close.
opw-3217616
closesodoo/odoo#116580
X-original-commit: e08aa67009b191cb99dfb1f7f1d0cb9d6539376a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Before this commit user was able to select calendars from
differant companies even though user is not allowed to read
that companies record.
This commit add field related to country company and use
it in a domain to restrict user to select on availble
calendars.
task-3078009
closesodoo/odoo#109904
Related: odoo/enterprise#37334
Signed-off-by: Kevin Baptiste <kba@odoo.com>
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.
closesodoo/odoo#115845
X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.
The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.
closesodoo/odoo#114533
Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The type fields of actions already defaults to
the model name in the base model definition.
Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).
closesodoo/odoo#114539
Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
The method update_state is called from cron. When the contracts are
updated couple things are checked. There are constraints set that can
throw ValidationError. As a result, none of the contract states are updated.
In this PR we do the following:
In case the ValidationError occurs when we run the cron, we update
contracts that can be updated, and silently pass the invalid contracts.
task - 3069480
bloupbloup
closesodoo/odoo#114566
X-original-commit: bce0d7d0f11d46c671bc2b902d17d80febeefa5f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The method `get_contract_wage_field()` was always called with a single
contract record, and from a functional point of view, it doesn't make
sense to call it on 2 records from different countries anyway.
task-2801710
closesodoo/odoo#113731
Related: odoo/enterprise#26373
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Before this commit, the widget's description was stored on the
component and this component was then registered.
Now, an object describing the widget is used on registration the same way
as it is done for views since b828cfc.
This split the component's description (props, template, ...) of
the widget's description ( component, extractProps, ...) and makes
it clearer.
We did the same thing for fields in 9f4622492c
Part of task: 3179751
closesodoo/odoo#112962
Related: odoo/enterprise#37215
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose
=======
Add a new type on the working schedule, adding "Lunch" to Morning and Afternoon. It's mandatory, because, if you don't do that, you can't assume the difference between a time that should be recorded as extra hours and a time that should not be counted because it's lunch time.
A company is not another, so to be clear, they will define what are the imposed lunch time where the employee is not paid during the week.
Specification
=============
Lunch between Morning and Afternoon
When a time period is under Lunch :
- There is no working entry generated for that period of time.
- If you work before the lunch time and after it, it's not considered as extra time.
- The employee is not paid for the Lunch time.
closesodoo/odoo#108061
Taskid: 3102363
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
Add a new type on the working schedule, adding "Lunch" to Morning and Afternoon. It's mandatory,
because, if you don't do that, you can't assume the difference between a time that should be
recorded as extra hours and a time that should not be counted because it's lunch time.
A company is not another, so to be clear, they will define what are the imposed lunch time
where the employee is not paid during the week.
Specification
=============
Lunch between Morning and Afternoon
When a time period is under Lunch :
- There is no working entry generated for that period of time.
- If you work before the lunch time and after it, it's not considered as extra time.
- The employee is not paid for the Lunch time.
TaskID: 3102363
https://github.com/odoo/odoo/commit/fa1b4f14257ca04c85c7541fd94b19dff939626c
caused an issue when a user doesn't have the `hr.group_hr_user` and
has the `hr_contract.group_hr_contract_employee_manager` group.
A user who doesn't have `hr.group_hr_user` can not have access to the
`hr.employee`, but has access to `hr.employee.public`. The
problem is that `hr.employee.public` doesn't have the `contract_id`
field.
opw-3148092
closesodoo/odoo#111752
X-original-commit: fa6fea0ddce67ae9a3a4244b91c2f1ea79cf3d6d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
- Automatically compute the average number of hours per day on
resource.calendar;
- Don't allow to change the working hours of an employee when they have
a current running contract;
- Seperate smart buttons on resources to distinguish Material / Human.
task-3102517
closesodoo/odoo#109768
Related: odoo/enterprise#35718
Signed-off-by: Kevin Baptiste <kba@odoo.com>
before this commit, to update the string for departure_date field the entire field has been replaced
after this commit, using attribute selector(string) updated the string for this field
closesodoo/odoo#110649
Signed-off-by: Kevin Baptiste <kba@odoo.com>
- Remove the contract from HR Settings as it's already showing from the
smartbutton;
- Move `job_id` from the HR Settings;
- Move the Payroll group to the Belgian payroll localization.
task-3127455
closesodoo/odoo#109552
Related: odoo/enterprise#35621
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit separate the templates, one for the card and another one for
the menu (the ellipsis dropdown).
The new template, called 'kanban-menu', will only contain the dropdown.
Note that, this behaviour is the same as the one used for the kanban
tooltips.
closesodoo/odoo#107589
Task-id: 3096776
Related: odoo/documentation#3284
Related: odoo/enterprise#34962
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
With the new year transition, some demo data relative to the current
time are now inconsistent with each others:
- Some payslips starts 2 mount before now.
- the contract starts this year, first January.
This means that
- the contract starts 2023-01-01
- the payslips ends 2022-12-01
Leading to an error
"The following employees have a contract outside of the payslip period"
Note that it looks like there is a also a demo/admin inconsistency
in data but this is out of the scope of this fix.
X-original-commit: ae259f93b6ccaaec17a8d32df6282278e015c395
Part-of: odoo/odoo#108884
Before this commit, the cron related to contract expiration
only created an activity. Now, it also writes a message in order
to warn all concerned user.
task-3081295
closesodoo/odoo#106768
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When the contract has a working schedule different
from the employee's, a red triangle appears with a tooltip
explaining the reason. That tooltip was implemented in the
arch view using data-tooltip, which is not intended.
This commit adds an owl widget replacing that issue.
In order to test that tooltip warning, it's only needed
to go on any running contract and change the resource_calendar
so it's different to the one on the employee's page.
Same process on the employee form.
closesodoo/odoo#106760
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Before this commit, the contract smartbutton on the
employee page redirected to the contract history page.
After this commit, the user will be redirected to the running
contract or any contract if there is some, or towards a new
contract form otherwise. To access the contract history view,
a new smartbutton has been added on the contract form.
Also added some hr_responsible_id to contract in demo datas
to avoid having empty required fields for employee contracts.
task-3056891
closesodoo/odoo#105416
Related: odoo/enterprise#33799
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In the hr_contract_history list view, some owl code was set to
allow employee creation from that view. Since the create button
has been removed, that code was unused.
closesodoo/odoo#106264
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Add the hr_contract.group_hr_contract_employee_manager group on the contract_id field in hr_employee
to avoid having an access error once a user with Manager security group in Payroll tries to open the
Payroll app.
task-3053032
closesodoo/odoo#105753
X-original-commit: fa1b4f14257ca04c85c7541fd94b19dff939626c
Related: odoo/enterprise#33942
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Since odoo/odoo#95729
nodes with a `groups=` are completely removed from the views when
the user is not part of the group, instead of being made invisible.
In that PR, views have been adapted to add back fields, with invisible="1",
when they were required, for instance when they were used in a domain
of another field which was still there despite the user is not part
of the given group.
As `tree` views having `multi_edit="1"` where not considered
as editable views, the domain of fields in these views were not
validated:
- https://github.com/odoo/odoo/blob/1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc/odoo/addons/base/models/ir_ui_view.py#L1460
- https://github.com/odoo/odoo/blob/1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc/odoo/addons/base/models/ir_ui_view.py#L1321-L1322
while they are well required for the web client,
in `multi_edit="1"` this is possible to edit relational/many2one field,
and therefore it will do `name_search` calls using the domain of the
field, and therefore the fields used in these domains must always
be present in the views. Without it, a crash in the web client occurs
when attempting to edit the relational/many2one field.
This revision targets to consider the `multi_edit="1"` tree views
as editable, to make the field domains validated as they should be.
Hence, views are adapted to add back fields with `invisible="1"`
when they are required in domains of other fields.
Part-of: odoo/odoo#103790
In case an employee has multiple contracts in several companies, we need
to only keep the contract of the current company of the employee, as
there can be only one in the main view hr_contract_history.
Before this patch, contract_information CTE returns the same ID for both
contracts:
employee_id | company_id | id | is_under_contract
-------------+------------+--------+-------------------
681 | 1 | 146842 | 0
681 | 14 | 146842 | 0
After the patch, it returns:
employee_id | company_id | id | is_under_contract
-------------+------------+--------+-------------------
681 | 1 | 4009 | 0
681 | 14 | 146842 | 0
We need to fix the WINDOW clause to make sure the id of the contract
that is selected is the one in the same company as the employee/contract
being selected in the contract_information CTE.
This way when an employee has multiple contracts, there will still be
1 line for each contract, but each with a different contract ID.
closesodoo/odoo#102821
X-original-commit: 88fa430be8a0c164e100b5f3c2f16ae906cc9a54
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
Steps :
- On a new DB (no demo data). Say created at 15:00. - Go to planning.
- Add a shift for today.
- Set the dates from 08:00 to 17:00.
Issue :
The 'Allocated Time' = 02:00.
Cause :
We used to count from the resource creation min to the departure max. So, in this case, not from 08:00, but from 15:00.
While this might seem logical, it confuses users in onboarding.
Fix :
Calculate the whole time, regardless of the resource lifespan.
Notes :
- Similar issues solved with this commit :
> Once the shift validated, the avatar progress bar uses
the same allocated time.
> Same in Project Task gantt view.
- When contract is installed, if the resource does not have a contract, the Allocated Time = 0. Now, it is calculated from the resource calendar.
task-2983993
closesodoo/odoo#102732
X-original-commit: 6a61d1c4c56075ade36f6f32e7a61f1f6c771a6f
Related: odoo/enterprise#32547
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Users with both "HR Officer" and "Contract Administrator" access should
be able to archive employees even without Payroll access.
closesodoo/odoo#102102
X-original-commit: 765a6ec16b0a3c1cd86f7fc217bfb795a788d9c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
purpose:
Contract management is a prior thing on an employee profile;
Thus, Contract smartbutton should be in the second position,
after Documents smartbutton, in case documents_hr is installed.
task - 2984690
closesodoo/odoo#100532
Related: odoo/enterprise#31481
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Following https://github.com/odoo/enterprise/pull/31202, it happens that the query for the contract history returns several times the same id if the employee has several contracts.
This commit fixes it by adding a DISTINCT to the SQL query so that ID returned are unique.
task-2974531
closesodoo/odoo#100027
Related: odoo/enterprise#31202
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In order to avoid empty contract histories when there are existing but
cancelled contracts, cancelled contracts are now also included in the
contract history.
task-2939158
closesodoo/odoo#99767
Signed-off-by: Kevin Baptiste <kba@odoo.com>
hr_*:
hr
hr_contract
hr_recruitment
website_hr_recruitment
Increase UX and possibilities to postulate to a job on recruitement.
Also moves the model hr.contract.type from hr_contract to hr so that it
can also be used from hr_recruitment without having two models in parallel.
taskID 2898063
closesodoo/odoo#96551
Related: odoo/enterprise#29777
Related: odoo/upgrade#3861
Signed-off-by: Kevin Baptiste <kba@odoo.com>