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
HR Responsible should be limited to the employee's of the contract's
company.
closesodoo/odoo#78320
Taskid: 2668125
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Purpose
=======
The "first contract date" is a usefull information for anybody who onboards
new colleagues. Issue: this information is not on the "public employee" and so,
visible only by hr officer (minimum).
With this task, we would like make this field public and visible by any internal
user in the system. In this way, we don't have to provide too many access rights
to any employees.
closesodoo/odoo#73552
Taskid: 2584098
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
- 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
closesodoo/odoo#72402
Taskid: 2558171
Related: odoo/enterprise#19124
Related: odoo/upgrade#2583
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).
Models -> Fields
1) fleet.vehicle -> description
2) fleet.vehicle.log.contract -> notes
3) hr.job -> description
4) hr.contract -> note
5) hr.leave.allocation -> notes
6) hr.applicant -> description
7) lunch.product -> description
8) lunch.order -> product_description
9) lunch.product.report -> description
Task Id: 2499504
X-original-commit: afe52b050a7667f3f20696cd48cd922f635a941c
Hide fields related to belgian localisation when not using a belgian
company.
Task Id: 2496597
closesodoo/odoo#69691
Related: odoo/enterprise#17881
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This reverts commit 825b533ec964fd8a9923dd4d2091f122b92d8759.
For the following reasons:
- This is a behavior change on a stable release. See our stable policy:
https://github.com/odoo/odoo/wiki/Contributing#what-does-stable-mean
- If a contract end date is set, it's erased when moving the contract afterward.
- There is a cron which is moving the expired contracts automatically,
this will rewrite the end date on it, which is not a big deal, but this
is useless.
- Modifying the contract end date also unlink all the work entries that are
outside of the new contract period. If there is an open payslip, it also
recomputes the worked days lines, and the payslip lines.
That way, it's possible to recompute a payslip by introducing unpaid
time off inside of it. If the payroll officers are checking the payslips
at that time, and don't notice it (already checked, etc...), then at the
validation, this could lead to some more serious issues (wrong net salary
paid to the employee, wrong accounting entries, wrong declaration to the
state, etc).
If the contract end date is badly configured, this is normal that the
reporting is wrong. No need to add some magic that people don't understand,
that could lead to wrong behaviors later on the process.
closesodoo/odoo#68541
X-original-commit: c34b6bc3d0d25e8b8b1bcb6684331627b823f57d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
When we want to retrieve all the contract (running for instance), we
don't care about the fact that the employee is archived or not.
For example when we generate the work entries to generate the payslips,
we actually pay the employee, even if he's archived (which is the
normal flow).
closesodoo/odoo#66836
X-original-commit: 262bf8598f9d885382c05e523543019767b521bf
Related: odoo/enterprise#16677
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When changing a contract's state to "Expired", if the contract has an
end date, the latter is not updated. As a result, contracts' reporting
contains some error.
To reproduce the error:
1. Create an employee E
2. Create a contract C
- Employee: E
- Start date: in the past
- End Date: in the future (! at least after the current month)
3. Set contract's state to "Expired"
4. Go to Employee > Reporting > Contracts
5. On pivot view, change the rows:
- Total must be split into "Date > Month"
- Current month must be split into "Employee"
Error: on current month, "# Departure Employee" of E-employee is 0. It
should be 1. This value's computation is based on `contract.date_end`,
but when changing the state to "Expired", the variable will not be
updated if it already has a value. So "# Departure Employee" will be
equal to 1 for the month of end date defined on step 2, instead of
current month.
Note: The fix result can not be directly tested. The end date must be
done for the departure to be effective (`contract.date_end` < 'today').
Since this fix updates `contract.date_end` to 'today', "# Departure
Employee" will not count this contract until the following day.
OPW-2445504
closesodoo/odoo#66002
X-original-commit: 3cfc1e7dc3ad8396a92d12f74b65485e5938077a
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Purpose
=======
Currently there's no easy way to retrieve all the contract using a given
calendar.
closesodoo/odoo#65621
Related: odoo/enterprise#16157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Otherwise, they may crash or be incorrectly verified when
creating/updating recordsets containing multiple records.
Also improve the constraint error messages to be more detailed.
When possible, use a sql constraint instead to speed up the records
validation.
Task Id: 2328664
COM PR: https://github.com/odoo/odoo/pull/55525
ENT PR: https://github.com/odoo/enterprise/pull/12250
Before this commit:
It was complicated to manage the contracts as they were all displayed in
one view.
When the contract was a time credit one (which is by definition a temporary
situation) the data used was based on the time credit and not on the full time
equivalent. This usually forced the HR to create fake new contracts without
time credit for the appraisals.
After this commit:
A new report will ease the followup of contracts with the time running.
It comes with a new view that highlight the reference information which
allow to easily manage credit time. Simulation is also made on FTE data which
eases HR work.
This commit also fixes a bug in the simulation with the meal voucher (only one
was taken into account in the summary right panel.
The wage on signature is now populated when the document is signed.
Closesodoo/odoo#58120
Related PR: odoo/enterprise#13384, odoo/upgrade#1802
task-2326407
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.
Impacted modules:
hr, hr_contract, hr_recruitment, hr_payroll, fleet, hr_skills, hr_appraisal, ....
Several onchanges have been converted to computed fields in the following modules :
Community :
- hr
- hr_contract
- hr_recruitment
- hr_work_entry
- hr_maintenance
- hr_expense
- hr_expense_check
- hr_holidays
- sale_expense
- account_analytic_default_hr_expense
Enterprise:
- hr_contract_salary
- hr_referral
- hr_payroll
- hr_payroll_expense
- test_l10n_be_hr_payroll_account
There are still 2 onchanges with complex behavior that couldn't be converted easily:
- an onchange that updates "tz" (timezone) that is defined as a related field
to "resource_id.tz". Apparently it is useless except to initialize the default
value of "tz".
- an onchange that updates "name" that is defined as a related field to
"resource_id.name".
the applicant.
closesodoo/odoo#45414
Taskid: 2169099
Related: odoo/enterprise#8572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The field `medic_exam` is not used anywhere and can thus be removed.
closesodoo/odoo#49631
Taskid: 2239321
Related: odoo/upgrade#1075
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
+ Add helper method to retrieve the contract wage.
Those methods are supposed to be overriden in some cases.
closesodoo/odoo#48258
Taskid: 2222984
Related: odoo/enterprise#9454
Related: odoo/upgrade#980
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
Even if you don't manage your payroll using Odoo, it could interesting to
categorize your contract (CP200, ...), in case you manage several kind
of workers or employees in your company.
TaskID: 2148537
An HR user (without any rights on contracts) could not open
an employee form view since it needs the `first_contract_date`
field which needs contracts access rights.
closesodoo/odoo#47561
X-original-commit: 14855eee0f9c5737ee5aaa792defe88e138e0d7d
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Before this commit:
When we change a contract to stage 'open', we write this contract
on employee. But it causes error when it's a template contract
(without employee).
After this commit:
When we change a contract to stage 'open', we write this contract
on employee only if contract has an employee.
[FIX] hr_contract: Allow overlapping in template contract
Before this commit:
We check for all contract that there are no overlapping for a
same employee.
After this commit:
We check that there are no overlapping for contract with
employee.
[FIX] hr_payroll, hr_holidays: Avoid some constrains with company time off
Before this commit:
We can't create company (or team) time off if you have 2 or more
template contract in your database.
We can't create mutliple company or team time off that overlaps.
After this commit:
We can create company (or team) time off if you have 2 or more
template contract in your database.
If a time off is set across multiple contract, print those contracts
in error message.
We can create multiple company or team time off that overlaps.
closesodoo/odoo#45696
Taskid: 2196185
X-original-commit: 3fdada6f8f19ae7123d9b35b3e7c557d072c1bc0
Related: odoo/enterprise#8553
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
Purpose fo the task is to improve the usability of hr contract and
automatic alert before contract expired
-improve sign demo data
-improve kanban state field in contract kanban
-improve contract Form view ui
-set first contract date on employee form
-added the date of last completed contract on the new contract
-improve signature request form
-create automatic activity before the week of contract expired date
closes odoo/odoo#40789
Task: 2049413
Closes: #40789
Related: odoo/enterprise#7454
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>
Make some fields editable in multi edit.
Some onchange are tranformed in compute fields.
id=2078674
closesodoo/odoo#39711
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When the many2xxx field relates to a model where company_id is required, set
this domain [('company_id','=',company_id.id)]
When the company_id field of the related model is not required, set this domain
['|',('company_id','=',company_id.id),('company_id','=',False)]
When setting the domain on a field which is in the treeview of a xxx2many field
evaluate against the company_id of the 'parent'.
Some constraints have been added on sereval models. Take a look at the complete
specification for more details.
TaskID: 2024446
Closes: #35266
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
* account, hr_contract, hr_expense, point_of_sale, sale_margin,
website_sale_delivery, website_sale_wishlist
digits only works on Float fields, on Monetary fields it has no
effect:
- The column_type of a monetary field is always numeric
- It is not applied in `convert_to_column()` or `convert_to_cache()`
- It is not part of `description_attrs`, so it will not be included in
the output of `fields_get()`
closesodoo/odoo#35336
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
Social secretariat is a Belgian concept. It does not make
sense to have this in the standard contract app.
Will be reintroduced in l10n_be_hr_payroll (or internal)
if really needed.
Move `job_id` in the right group to easily add fields
on the right with view inheritance.
The goal is to be coherent with the user property.
Actually, company_id and company_ids on the environment are no fields.
Calling env.company_id returns a browse record, not an id.
Purpose
=======
Having some usability check to be sure to make the pay
for everyone, and don't loose contracts.
We would like to remove incoming and to renew columns in
hr.contract and replace them by a kanban state. In employee, we would
like to add warning on the kanban to warn the hr responsible there
is no contract or a contract is about to expire
Specification
=============
hr.contract kanban:
- add a kanabn state
- it becomes red automatically when the contract is in running and expire in 7 days
- add aquick search in filter to filter on expered soon
- the kanban state can be changed manaually (in case of there is several rh)
- sort by contract end date set first (more close of today first)
Employee kanban
- add an red icon if there is no contract in Runnig status OR there is a
kanban state red in their contract (whatever the status).
- add a quick seaach on employee with warning
- State pending + green = incoming
- State confirmed + red = about to expire / to renew
closesodoo/odoo#33489
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
An employee and its current contract should have the same
calendar. Currently, if the contract's calendar is changed,
the employee's calendar is not changed.
In the same way, if a contract is created directly in `open`
state, the employee's calendar is not changed.
Finally, the calendar synchronization when the employee
contract is changed is only done in payroll, for no reason.
Specification
=============
Fix the three issues described above.
If the employee's calendar is nonetheless manually changed, a warning
should be displayed if there is a mismatch between both calendars.