Daily updates from Odoo
Navigate
Branch
Tuesday, March 19, 2019
17 changes
New functionality added to Odoo
Users can now choose to show or hide selected columns in list views using a dropdown with checkboxes. This makes busy lists easier to read while still allowing users to reveal extra information when needed.
Original PR description
Task : https://www.odoo.com/web#id=1902765&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 Pad : https://pad.odoo.com/p/openerp-project.task-U14WAF1PHG -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Payroll benefits can now be managed in a Gantt timeline view by default instead of a calendar view. The update adds colors and action buttons to make benefit periods easier to understand and manage at a glance.
Original PR description
Add colors and buttons to benefit gantt view and use it by default instead of the calendar view
Enhancements to existing features
Attachment and picture previews in chat windows are now displayed at a larger size. This makes shared files and images easier to view directly in conversations, improving readability and day-to-day usability.
Original PR description
Task Link: https://www.odoo.com/web#id=1941601&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720 Pad Link: https://pad.odoo.com/p/r.393faf958ee09a5d0062ca416709cfa1 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Sales orders that only contain services or other non-shippable items will no longer show the delivery button. This reduces confusion for sales users by removing an action that has no practical use for those orders.
Original PR description
Hide button delivery when no consumable or storable products in the SO Avoid showing useless buttons on SO Task : https://www.odoo.com/web#id=1940491&action=327&model=project.task&view_type=form&menu_id=4720 Pad : https://pad.odoo.com/p/r.9ba25b413b62a73b6808e2dec019218e I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Belgian payroll now supports managing employee departures, including notice duration calculations and follow-up documents. Businesses can generate reports for termination fees when notice is not respected, as well as certificates for unused and future-year time off at the end of the notice period.
Original PR description
Description of the issue/feature this PR addresses:
When an employee departure the company, in Belgium, we need to:
- If provided notice
- compute the Out Notice Duration
- at the end of the notice compute time off amount for N-1
- at the end of the notice compute time off amount for current year
- If unprovided notice
- Compute termination fees depending of Notice Duration
- compute time off amount for N-1
- Compute time off amount for current year
Current behavior before PR:
Nothing about employee departure
Desired behavior after PR is merged:
Compute notice duration and if the notice duration is not respected,
a report about termination fees is generated.
At the end of the notice duration, we can generate a certificate
about time off not taken and an other about time off for the next
year.
id=1914556
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prEmployee benefits management now opens in a Gantt-style planning view by default, with clearer color coding and action buttons. This makes benefit timelines easier to review and manage compared with the previous calendar-focused experience.
Original PR description
Add colors and buttons to benefit gantt view and use it by default instead of the calendar view -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The website editor now includes improvements to the customization panel used when editing page snippets and customer-facing point-of-sale displays. This makes it easier for users to adjust visual content and provides a more consistent editing experience across website and POS display areas.
UPS shipping integration now supports generating return labels, making it easier for businesses to manage customer returns directly through Odoo. This helps streamline reverse logistics and reduce manual work when handling returned goods.
Users can now generate and print return shipping labels for BPost deliveries directly from Odoo. This makes handling returns smoother and reduces manual work for businesses using BPost shipping.
HR salary contract forms can now request personal documents directly from employees, making it easier to collect required information during contract setup. The change improves the employee workflow by keeping document-related actions tied to the employee and modernizing the form interaction.
The website form editor customization panel has been updated to improve the editing experience. This helps users configure website forms more smoothly and supports better control over form presentation.
Resolved issues and error corrections
This update fixes several permission issues that prevented HR, payroll, contract, and team leader users from completing everyday leave and employee management tasks. It also makes benefit setup easier from Payroll and improves benefit conflict checks, helping payroll preparation run more smoothly and faster.
Original PR description
https://github.com/odoo/enterprise/pull/3810 adds some tests which highlights some issues (mainly access rights issues). This PR fixes them -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The subscription expiration warning now explains that the issue may be caused by either extra users or unpurchased apps. This reduces customer confusion when the warning appears after installing an app rather than adding users.
Original PR description
Right now the warning for the database expiration warning says you have more users. If you install an extra app that is not purchased the same warning will go off though. This PR expands the message so it is always correct. Right now it confuses customers if they haven't added any users.
This update removes an unused employee status field that could trigger access errors when contract managers created contracts. It also adds broader payroll flow testing to help ensure key HR payroll steps continue to work with the right permissions.
Code cleanup and technical improvements
Payroll contribution registers are replaced with direct partner links on payslip lines, simplifying how contributions are associated with third parties. This helps payroll and accounting data stay more consistent across companies and localizations, while preserving reporting needs.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This change simplifies payroll configuration by removing hidden salary rule hierarchies and making each salary structure show its own rules directly. It also introduces salary structure types for easier contract defaults and fixes several HR, leave, contract, fleet, and payroll access issues so responsible users can complete approvals and contract setup more reliably.
Original PR description
hr_payroll: Remove parent_id hierarchy + Add structures categorization ---------------------------------------------------------------------- 1/ Remove the parent-children relation on salary…
hr_payroll: Remove parent_id hierarchy + Add structures categorization
----------------------------------------------------------------------
1/ Remove the parent-children relation on salary structures
Currently it is difficult to see what rules are applied on salary structures.
Most of the structures are inheriting 3 rules (Basic, Gross, Net) from the
'Base for new structures', and those rules are not shown. Same issue if a
structure has another one as parent (as in the French localization).
This bring more annoying issues:
- Since the saas-12.1, we can already set different accounts for different
companies on the salary rules for which we want to post journal entries.
But for the parent rules, like the 'NET' amount, it's impossible to post
the journal entries on different account for different salary structures.
(eg: for CP200 employees and CP200 workers). As the rules are following
a M2M relation on the structure, we have to remove the parent_id and to
recreate all the rules in the final structure.
- If we are not at ease with the M2M relation (which is the case for most
of the end users), we will simply modify the rule on the parent structure.
This was already done on the French localization on which we modified the
code, sequence and the name. This could have some desastrous consequences
as this will break the order on which the rules are computed for other
structures for the sequence, or break other integration with the payroll
as we also modify the code, for example the salary configurator.
As this parent-children relation on structure could cause several issues
difficult to spot and as this is quite difficult to correctly visualize the
structure composition, it is better to remove it and define all the rules
inside the structure itself. This improves also the code readability as we
are not trying to recursively retrieve the rules and find a proper sequence
inside them.
2/ Make the rules on the salary structure a o2m instead of a m2m
The issues described just above indicates that it would be better to remove
the M2M relation between salary structures and salary rules, and make it
a O2M relation instead. That way, no more confusion and misconfiguration of
the rules fields (code, sequence, accounts, ...).
3/ Remove the parent-children relation on rules
A salary rule can have a parent salary rule. This mechanism, which is
not obvious at all for an end user allows to specify a parent rules.
If the condition is met for the parent rule (eg: the employee has at least
1 child), all the children rules could be applied (eg: Deduction of 90 euros
if the number of children is between 1 and 1).
Visually it doesn't make a lot of sense, as it displays one line with an
amount of 0 for the parent, and one line with the real amount for each
applied child. On the other hand, no child rule is linked to the structure
and an end user has to click on the parent rule, to see the children and
understand that something mystic and hidden is existing.
This is equivalent to define as many classic rules as we have children, or
even better, define 1 rule that will compute the real amount directly,
as the number of children can be accessed from the localdict when computing
the salary line.
This commit also removed the relation.
4/ Clean some brols in the code (technical)
The 3 first points of the spec allow us to clean a little the code readability
and complexity.
5/ Adapt all the localizations for these changes
All the localizations are impacted by those changes. What is done in this commit
is mainly:
- l10n_be_hr_payroll: Make 3 separated files for the 3 existing structures (the
fourth one, belgian worker, is not correct and is removed). For each
structure, define explicitely the rules (in the correct order by sequence).
This multiplies the total number of rules as some of them were shared (like
the withholding tax rule for example), but all the code that is supposed to be
modified each year/quarter/whenever the government decides to modify the law
has been moved into a python file, and is available the computation context.
This will also allow us to update the computation rules without having to
update the module.
- l10n_fr_hr_payroll: There were 3 rules following this scheme:
```
Base for new structure
|
Basic structure
|
----------------------
| |
Cadre Non-Cadre
```
All the rules parent rules have been duplicated into the 2 remaining
structures, cadre and non-cadre. There were a lot of parent-children relations
between the rules that have been adapted to the new model.
- l10n_in_hr_payroll: There was a lot of rules in data, and a structure in demo
data, which was using 4 or 5 of these rules. As the rules doesn't seem to make
a lot of sense altogether, everything was moved in demo data.
6/ Introduce a new Salary Structure Type model
Currently we have a model hr.contract.type with a M2O on the contracts. This has
never been used in 9 years and is removed in this commit. On the other hand, we
would like to define a new model hr.payroll.structure.type (eg: CP200 Employee),
which will line all the salary structures the Belgian localization could bring
(Classic salary, double holidays, 13th month, ...). This field is defined on the
structure, and is displayed on the contract (as the same place than the contract
type we just removed).
On this model we could also define some fields like:
- The default pay period: Selection field, default = monthly. This is applied on
the contract when selecting the structure.
- The Working Schedule, m2o. This is applied on the contract when selecting the
structure
For example, on the 'commission paritaire' for teachers, we could set the
default pay period to 'Every 15 days' and the working schedule to '19 hours /
week'. Every contract under this structure would take those values.
Migration
=========
For a migration point of view:
- All the rules that had a parent_rule_id should be set to
appears_on_payslip=False. The column parent_rule_id can be dropped afterward.
- All the rules that are coming from a parent structure or higher should be
duplicated and the field 'struct_id' should be set on the current structure.
The column parent_id can be dropped afterward.
- All the rules that were defined on the structure should have the field
'struct_id' defined on them.
- The rules that are not linked to a structure should be unlinked.
- The column type_id on the contract could be dropped, no need to keep the
values too.
- A default structure type is defined in data ('Employee'). This could be set to
all the existing structure for the newly created 'type_id' field.
TaskID: 1942832
hr_payroll: rename hr.benefit into hr.work.entry
------------------------------------------------
It makes more sense to name an entry in the employee schedule like that.
TaskID: 1941598
hr_holidays: Group team leader imply group user
-----------------------------------------------
Currently, group Team Leader does not imply group user.
However a team leader is always a user and should be member of
the corresponding group.
hr_holidays: Allow Team leader to approve
-----------------------------------------
Currently, a Team leader can't approve a leave of an employee
in his team if the leave type requires an allocation.
The reason is the `ir.rule` for `base.group_user` restricting allocation
read access to only your own allocation
(`[('employee_id.user_id', '=', user.id)]`). There are no `ir.rule` for group
Team leader. Therefore, a team leader can't read allocations for his team
members.
Fix: add an `ir.rule` to allow a team leader to read allocations
of employees in his team.
+ add associated tests
hr_payroll: Fix contract access to approve leave
------------------------------------------------
When a `hr.leave` is approved, a `resource.calendar.leave`
is created in the employee's calendar and in the
contract's calendar if it's different.
However, a user in `group_holiday_user` but not in
`group_hr_contract_manager` does not have access rights
to read a contract.
This leads to an `AccessError`
Fix: use `sudo` to read the contract.
hr_contract: group_hr_contract_manager implies group_user
---------------------------------------------------------
A user with only the contract access rights should be able to create
a contract.
l10n_be_hr_payroll_fleet: Fix access rights issues
--------------------------------------------------
If a user is member of `hr_contract.group_hr_contract_manager`
but not member of `fleet.fleet_group_manager` some access issues arise
The issues are related to the `car_id` field of `hr.contract`
because the user has no access rights for `fleet.vehicle`.
Fix to solve the issue:
Make all car related field of contracts available
to fleet manager only.
If the contract manager want to be able to manage cars on
contracts, he must manually be granted fleet manager access.
This is a requirement if the contract manager want to use the
company car feature.
hr_payroll: Allow a contract manager to read salary structures
--------------------------------------------------------------
An employee with only the contract user group should be able to create
a contract. It implies to be able to read a salary structure and
a salary structure type.
hr_payroll: Add leave type One2many on benefit type
---------------------------------------------------
Purpose
=======
Currently, linking a benefit type and a leave type is done through
the leave type form view.
This is anoying because it requires to first create the benfit type,
then go to the leave type and link it.
Moreover, linking is the role of a payroll manager which should be
able to do it from the Payroll app.
Specification
=============
Add a One2many field `leave_type_ids` on `hr.benefit.type` to
allow to link a leave type when creating a benefit type.
commit a9f97a2c4342358c388558f0bf9ecc8ab787f399
Author: Lucas Lefèvre <lul@odoo.com>
Date: Mon Mar 4 16:06:33 2019 +0100
hr_payroll: Make payroll groups imply holiday groups
----------------------------------------------------
Purpose
=======
Currently, groups `hr_holidays.group_hr_holidays_[user|manager]`
and `hr_payroll.group_hr_payroll_[user|manager]` are independant.
A member of payroll groups is not able to approve/refuse a leave.
This is a problem as they should be able to approve/refuse leaves before generating payslips.
This is the point of `hr.benefits`: a global way of managing
attendances and leaves before generating payslips.
Specification
=============
Payroll groups should imply the corresponding
holiday group.
1. User
`hr_payroll.group_hr_payroll_user`
implies
`hr_holidays.group_hr_holidays_user`
2. Manager
`hr_payroll.group_hr_payroll_manager`
implies
`hr_holidays.group_hr_holidays_manager`
hr_contract: Allow contract managers to manage employee
-------------------------------------------------------
Contract managers should be able to create/manager employees.
This make sense when a contract manager hires someone.
He first creates the employee, then his contract.
This also allows contract managers to access private addresses
by transitivity.
This is also intended to allow a contract manager to set
a driver (private partner) on the employee's company car
or to access `km_home_work` for transport reimbursment
(l10n_be_hr_payroll).
hr_payroll: Improve benefits conflict performance
-------------------------------------------------
This commit changes the way benefits overlaps are detected.
Currently, all benefits are read from db and the
overlap detection is done in Python.
After this commit, use a single sql query to
only retreive overlapping benefits.
The query takes advantage of the postgresql
range type `tsrange` and the intersection operator
Performance improvements:
Tests with 500 employees and benefits generated for
15 months (~300000 records in the table)
Conflict detection over 1 month (~20000 records)
=> ~5X speedup (from more than 2s to less than 0.5s)
hr_holidays: Fix validation string typo
---------------------------------------
hr_holidays: Test access rights post install
--------------------------------------------
Some module can inherit leave models and override some methods.
The overridden method could access some models which require other
access level.
In this case, the access issues would not be found by tests because
other modules are not yet installed.
e.g.
Recently, the `_create_resource_leave` was overridden in hr_payroll and
is reading the employee's contract. A HR user approving a leave
would raise an access error because he doesn't have contract rights.
If the tests would have been executed post install, this bug would
have been detected.
project_timesheet_holidays: Fix leave validation rights issues
--------------------------------------------------------------
Currently, when a leave is validated, an `account.analytic.line`
is automatically created. However, the approver may not have
the access rights to do so.
This commit fixes the issues by using sudo to generate the line.
hr_holiday: Don't check access rights on allocation if no employee
------------------------------------------------------------------
If there are no employee set on the allocation request and if the user
is a leave officer, don't check the access rights as it would lead to
a traceback.
hr_payroll: enable color edition on hr benefit types
----------------------------------------------------
TaskID: 1947281
hr_payroll: extract common behaviour from custom calendar view
--------------------------------------------------------------
In order to implement the same features both in the calendar and in the
gantt view, we need to extract the behaviours that will be common into a
mixin.
TaskID: 1947281
base: enable usage of js_class on the gantt view
------------------------------------------------
TaskID: 1947281
hr_payroll: Use the structure type on contract instead of structure
-------------------------------------------------------------------
For usability purposes, it's better to set a structure type
on a contract (eg: CP200: Belgian Employee) instead of having
to choose between 'Belgian Salary', 'Double holidays', ...
hr_holidays: Don't check approval rights in onchange
----------------------------------------------------
When this method is called in the context of an onchange
`self.ids` is an empty list.
This is a problem when calling `holiday.check_access_rule('write')`
because it does not find any valid holidays and thus raises an AccessError.
hr_holidays: Skip validation rights if no validation
----------------------------------------------------
If validation type is set to `no_validation`, checking
if a target state is achievalbe should bypass
normal checks for the user's own leaves.
Otherwise, ir.rule raises an AccessError as the user
doesn't normally have the rights for leave in
state `validate`.
l10n_be_hr_payroll: Manage employee departure
---------------------------------------------
Compute notice duration and if the notice duration is not respected,
a report about termination fees is generated.
At the end of the notice duration, we can generate a certificate
about time off not taken and an other about time off for the next
year.
TaskID: 1914556
hr_payroll: replace contribution register by partner_id
-------------------------------------------------------
We replace contribution register model by a many2one on res.partner
directly on the payslip.line
Task 1928607
hr_payroll: add multicompany rule for payslip lines
---------------------------------------------------
TaskID: 1928607
hr_payroll: Use date_to_str on work entries generation
------------------------------------------------------
Purpose
=======
This aim to avoid sending a datetime that will be converted into UTC
and that way have a wrong date set on the payslip.
hr_payroll: Move to enterprise
------------------------------
For more information about this decision, please read
https://www.odoo.com/fr_FR/blog/notre-blog-5/post/odoo-community-enterprise-532Payroll configuration was reworked to make salary structures and rules explicit, easier to understand, and less prone to hidden setup errors. Payroll is also moved into Enterprise, with related contract salary improvements, Belgian payroll flow tests, and a new payroll Gantt view.
Original PR description
hr_payroll: Remove parent_id hierarchy + Add structures categorization ---------------------------------------------------------------------- 1/ Remove the parent-children relation on salary…
hr_payroll: Remove parent_id hierarchy + Add structures categorization
----------------------------------------------------------------------
1/ Remove the parent-children relation on salary structures
Currently it is difficult to see what rules are applied on salary structures.
Most of the structures are inheriting 3 rules (Basic, Gross, Net) from the
'Base for new structures', and those rules are not shown. Same issue if a
structure has another one as parent (as in the French localization).
This bring more annoying issues:
- Since the saas-12.1, we can already set different accounts for different
companies on the salary rules for which we want to post journal entries.
But for the parent rules, like the 'NET' amount, it's impossible to post
the journal entries on different account for different salary structures.
(eg: for CP200 employees and CP200 workers). As the rules are following
a M2M relation on the structure, we have to remove the parent_id and to
recreate all the rules in the final structure.
- If we are not at ease with the M2M relation (which is the case for most
of the end users), we will simply modify the rule on the parent structure.
This was already done on the French localization on which we modified the
code, sequence and the name. This could have some desastrous consequences
as this will break the order on which the rules are computed for other
structures for the sequence, or break other integration with the payroll
as we also modify the code, for example the salary configurator.
As this parent-children relation on structure could cause several issues
difficult to spot and as this is quite difficult to correctly visualize the
structure composition, it is better to remove it and define all the rules
inside the structure itself. This improves also the code readability as we
are not trying to recursively retrieve the rules and find a proper sequence
inside them.
2/ Make the rules on the salary structure a o2m instead of a m2m
The issues described just above indicates that it would be better to remove
the M2M relation between salary structures and salary rules, and make it
a O2M relation instead. That way, no more confusion and misconfiguration of
the rules fields (code, sequence, accounts, ...).
3/ Remove the parent-children relation on rules
A salary rule can have a parent salary rule. This mechanism, which is
not obvious at all for an end user allows to specify a parent rules.
If the condition is met for the parent rule (eg: the employee has at least
1 child), all the children rules could be applied (eg: Deduction of 90 euros
if the number of children is between 1 and 1).
Visually it doesn't make a lot of sense, as it displays one line with an
amount of 0 for the parent, and one line with the real amount for each
applied child. On the other hand, no child rule is linked to the structure
and an end user has to click on the parent rule, to see the children and
understand that something mystic and hidden is existing.
This is equivalent to define as many classic rules as we have children, or
even better, define 1 rule that will compute the real amount directly,
as the number of children can be accessed from the localdict when computing
the salary line.
This commit also removed the relation.
4/ Clean some brols in the code (technical)
The 3 first points of the spec allow us to clean a little the code readability
and complexity.
5/ Adapt all the localizations for these changes
All the localizations are impacted by those changes. What is done in this commit
is mainly:
- l10n_be_hr_payroll: Make 3 separated files for the 3 existing structures (the
fourth one, belgian worker, is not correct and is removed). For each
structure, define explicitely the rules (in the correct order by sequence).
This multiplies the total number of rules as some of them were shared (like
the withholding tax rule for example), but all the code that is supposed to be
modified each year/quarter/whenever the government decides to modify the law
has been moved into a python file, and is available the computation context.
This will also allow us to update the computation rules without having to
update the module.
- l10n_fr_hr_payroll: There were 3 rules following this scheme:
```
Base for new structure
|
Basic structure
|
----------------------
| |
Cadre Non-Cadre
```
All the rules parent rules have been duplicated into the 2 remaining
structures, cadre and non-cadre. There were a lot of parent-children relations
between the rules that have been adapted to the new model.
- l10n_in_hr_payroll: There was a lot of rules in data, and a structure in demo
data, which was using 4 or 5 of these rules. As the rules doesn't seem to make
a lot of sense altogether, everything was moved in demo data.
6/ Introduce a new Salary Structure Type model
Currently we have a model hr.contract.type with a M2O on the contracts. This has
never been used in 9 years and is removed in this commit. On the other hand, we
would like to define a new model hr.payroll.structure.type (eg: CP200 Employee),
which will line all the salary structures the Belgian localization could bring
(Classic salary, double holidays, 13th month, ...). This field is defined on the
structure, and is displayed on the contract (as the same place than the contract
type we just removed).
On this model we could also define some fields like:
- The default pay period: Selection field, default = monthly. This is applied on
the contract when selecting the structure.
- The Working Schedule, m2o. This is applied on the contract when selecting the
structure
For example, on the 'commission paritaire' for teachers, we could set the
default pay period to 'Every 15 days' and the working schedule to '19 hours /
week'. Every contract under this structure would take those values.
Migration
=========
For a migration point of view:
- All the rules that had a parent_rule_id should be set to
appears_on_payslip=False. The column parent_rule_id can be dropped afterward.
- All the rules that are coming from a parent structure or higher should be
duplicated and the field 'struct_id' should be set on the current structure.
The column parent_id can be dropped afterward.
- All the rules that were defined on the structure should have the field
'struct_id' defined on them.
- The rules that are not linked to a structure should be unlinked.
- The column type_id on the contract could be dropped, no need to keep the
values too.
- A default structure type is defined in data ('Employee'). This could be set to
all the existing structure for the newly created 'type_id' field.
TaskID: 1942832
hr_payroll: rename hr.benefit into hr.work.entry
------------------------------------------------
It makes more sense to name an entry in the employee schedule like that.
TaskID: 1941598
hr_holidays: Group team leader imply group user
-----------------------------------------------
Currently, group Team Leader does not imply group user.
However a team leader is always a user and should be member of
the corresponding group.
hr_holidays: Allow Team leader to approve
-----------------------------------------
Currently, a Team leader can't approve a leave of an employee
in his team if the leave type requires an allocation.
The reason is the `ir.rule` for `base.group_user` restricting allocation
read access to only your own allocation
(`[('employee_id.user_id', '=', user.id)]`). There are no `ir.rule` for group
Team leader. Therefore, a team leader can't read allocations for his team
members.
Fix: add an `ir.rule` to allow a team leader to read allocations
of employees in his team.
+ add associated tests
hr_payroll: Fix contract access to approve leave
------------------------------------------------
When a `hr.leave` is approved, a `resource.calendar.leave`
is created in the employee's calendar and in the
contract's calendar if it's different.
However, a user in `group_holiday_user` but not in
`group_hr_contract_manager` does not have access rights
to read a contract.
This leads to an `AccessError`
Fix: use `sudo` to read the contract.
hr_contract: group_hr_contract_manager implies group_user
---------------------------------------------------------
A user with only the contract access rights should be able to create
a contract.
l10n_be_hr_payroll_fleet: Fix access rights issues
--------------------------------------------------
If a user is member of `hr_contract.group_hr_contract_manager`
but not member of `fleet.fleet_group_manager` some access issues arise
The issues are related to the `car_id` field of `hr.contract`
because the user has no access rights for `fleet.vehicle`.
Fix to solve the issue:
Make all car related field of contracts available
to fleet manager only.
If the contract manager want to be able to manage cars on
contracts, he must manually be granted fleet manager access.
This is a requirement if the contract manager want to use the
company car feature.
hr_payroll: Allow a contract manager to read salary structures
--------------------------------------------------------------
An employee with only the contract user group should be able to create
a contract. It implies to be able to read a salary structure and
a salary structure type.
hr_payroll: Add leave type One2many on benefit type
---------------------------------------------------
Purpose
=======
Currently, linking a benefit type and a leave type is done through
the leave type form view.
This is anoying because it requires to first create the benfit type,
then go to the leave type and link it.
Moreover, linking is the role of a payroll manager which should be
able to do it from the Payroll app.
Specification
=============
Add a One2many field `leave_type_ids` on `hr.benefit.type` to
allow to link a leave type when creating a benefit type.
commit a9f97a2c4342358c388558f0bf9ecc8ab787f399
Author: Lucas Lefèvre <lul@odoo.com>
Date: Mon Mar 4 16:06:33 2019 +0100
hr_payroll: Make payroll groups imply holiday groups
----------------------------------------------------
Purpose
=======
Currently, groups `hr_holidays.group_hr_holidays_[user|manager]`
and `hr_payroll.group_hr_payroll_[user|manager]` are independant.
A member of payroll groups is not able to approve/refuse a leave.
This is a problem as they should be able to approve/refuse leaves before generating payslips.
This is the point of `hr.benefits`: a global way of managing
attendances and leaves before generating payslips.
Specification
=============
Payroll groups should imply the corresponding
holiday group.
1. User
`hr_payroll.group_hr_payroll_user`
implies
`hr_holidays.group_hr_holidays_user`
2. Manager
`hr_payroll.group_hr_payroll_manager`
implies
`hr_holidays.group_hr_holidays_manager`
hr_contract: Allow contract managers to manage employee
-------------------------------------------------------
Contract managers should be able to create/manager employees.
This make sense when a contract manager hires someone.
He first creates the employee, then his contract.
This also allows contract managers to access private addresses
by transitivity.
This is also intended to allow a contract manager to set
a driver (private partner) on the employee's company car
or to access `km_home_work` for transport reimbursment
(l10n_be_hr_payroll).
hr_payroll: Improve benefits conflict performance
-------------------------------------------------
This commit changes the way benefits overlaps are detected.
Currently, all benefits are read from db and the
overlap detection is done in Python.
After this commit, use a single sql query to
only retreive overlapping benefits.
The query takes advantage of the postgresql
range type `tsrange` and the intersection operator
Performance improvements:
Tests with 500 employees and benefits generated for
15 months (~300000 records in the table)
Conflict detection over 1 month (~20000 records)
=> ~5X speedup (from more than 2s to less than 0.5s)
hr_holidays: Fix validation string typo
---------------------------------------
hr_holidays: Test access rights post install
--------------------------------------------
Some module can inherit leave models and override some methods.
The overridden method could access some models which require other
access level.
In this case, the access issues would not be found by tests because
other modules are not yet installed.
e.g.
Recently, the `_create_resource_leave` was overridden in hr_payroll and
is reading the employee's contract. A HR user approving a leave
would raise an access error because he doesn't have contract rights.
If the tests would have been executed post install, this bug would
have been detected.
project_timesheet_holidays: Fix leave validation rights issues
--------------------------------------------------------------
Currently, when a leave is validated, an `account.analytic.line`
is automatically created. However, the approver may not have
the access rights to do so.
This commit fixes the issues by using sudo to generate the line.
hr_holiday: Don't check access rights on allocation if no employee
------------------------------------------------------------------
If there are no employee set on the allocation request and if the user
is a leave officer, don't check the access rights as it would lead to
a traceback.
hr_payroll: enable color edition on hr benefit types
----------------------------------------------------
TaskID: 1947281
hr_payroll: extract common behaviour from custom calendar view
--------------------------------------------------------------
In order to implement the same features both in the calendar and in the
gantt view, we need to extract the behaviours that will be common into a
mixin.
TaskID: 1947281
base: enable usage of js_class on the gantt view
------------------------------------------------
TaskID: 1947281
hr_payroll: Use the structure type on contract instead of structure
-------------------------------------------------------------------
For usability purposes, it's better to set a structure type
on a contract (eg: CP200: Belgian Employee) instead of having
to choose between 'Belgian Salary', 'Double holidays', ...
hr_holidays: Don't check approval rights in onchange
----------------------------------------------------
When this method is called in the context of an onchange
`self.ids` is an empty list.
This is a problem when calling `holiday.check_access_rule('write')`
because it does not find any valid holidays and thus raises an AccessError.
hr_holidays: Skip validation rights if no validation
----------------------------------------------------
If validation type is set to `no_validation`, checking
if a target state is achievalbe should bypass
normal checks for the user's own leaves.
Otherwise, ir.rule raises an AccessError as the user
doesn't normally have the rights for leave in
state `validate`.
l10n_be_hr_payroll: Manage employee departure
---------------------------------------------
Compute notice duration and if the notice duration is not respected,
a report about termination fees is generated.
At the end of the notice duration, we can generate a certificate
about time off not taken and an other about time off for the next
year.
TaskID: 1914556
hr_payroll: replace contribution register by partner_id
-------------------------------------------------------
We replace contribution register model by a many2one on res.partner
directly on the payslip.line
Task 1928607
hr_payroll: add multicompany rule for payslip lines
---------------------------------------------------
TaskID: 1928607
hr_payroll: Use date_to_str on work entries generation
------------------------------------------------------
Purpose
=======
This aim to avoid sending a datetime that will be converted into UTC
and that way have a wrong date set on the payslip.
hr_payroll: Move to enterprise
------------------------------
For more information about this decision, please read
https://www.odoo.com/fr_FR/blog/notre-blog-5/post/odoo-community-enterprise-532