Daily updates from Odoo
Monday, June 12, 2023
3 changes · master
Resolved issues and error corrections
Planned hours on sales order lines now include planning slots without an assigned resource and refresh correctly after demo data or allocation changes. This gives sales and project teams more reliable planned workload and billing-related figures, while still excluding material resources where appropriate.
Original PR description
**[FIX] planning: fix _compute_planning_hours_planned** Before this commit: - sale_planning module: 1- When a planning slot doesn't have a resource (resource_id = False), its allocated_hours is not…
**[FIX] planning: fix _compute_planning_hours_planned**
Before this commit:
- sale_planning module:
1- When a planning slot doesn't have a resource (resource_id = False),
its allocated_hours is not counted when computing planning_hours_planned
of its sale_line_id.
2- The value of planning_hours_planned is wrong after installing
the demo data, the allocated hours of the last added planning_slot
are missing in the sum.
- project_timesheet_forecast_sale module:
When _compute_planning_hours_planned was inherited, the check on the material
resource was not taken into account
After this commit:
- sale_planning module:
1- the bug is fixed,
technically: the where part of the query was changed from
```
WHERE resource_id" in
(
SELECT id
FROM resource_resource
WHERE resource_type != 'material'
OR "resource_resource"."resource_type" IS NULL
)
```
to
```
WHERE resource_id IS NULL
OR resource_id" in
(
SELECT id
FROM resource_resource
WHERE resource_type != 'material'
OR "resource_resource"."resource_type" IS NULL
)
```
2- Technically, the problem is when _compute_allocated_hours is called for
the planning slots linked to the concerned sale_line_id, the compute method
that should be called to compute planning_hours_planned after each modification
in the value of the allocated_hours field is not called so we have a wrong value.
So, in this commit, an add_to_compute is added to force that compute.
- project_timesheet_forecast_sale:
The same previous condition was added to the query to filter by material
resources.
task-3299506The French balance sheet now keeps its totals balanced while showing the current year profit or loss in the right line. Prior-year earnings are also separated more accurately, reducing the risk of confusing financial report figures.
Original PR description
The aim of this PR is to ensure that the Balance Sheet is always balanced while ensuring that the Résultat de l'exercice line shows the total from the Profit & Loss report. We also introduce tests ensuring this behaviour. Task 3060790
Access to Belgian payroll reports is now made more consistent for users working outside Belgian companies. The change prevents most entry points, such as menus and quick search, from opening reports that should not be available, reducing confusion and accidental access errors.
Original PR description
Previously to restrict users from accessing belgian reports from a non-belgian company we used default_get with a check on the company. This works, but only when the user actually tries to create a record, so from a user's perspective, sometimes he can go into a tree view before getting the access error and sometimes he can't even click on the menu in the navbar. This commit tries to unify the experience from the most common access points to the actions: menu and CTRL+K search bar. It is still possible to land in the action if you go there from a Belgian company, then log into a non-belgian company, this is why the default_get checks stay in the code for now, as I couldn't find a better solution. task 3344749