Monday, May 19, 2025
2 changes · master
Resolved issues and error corrections
This fix ensures project planning correctly identifies overlapping tasks when filters include related information. It helps prevent scheduling conflicts from being missed and improves the reliability of planning calculations and related tests.
Original PR description
The query that determines overlapping tasks is making two different Query objects: the first one for the main task and the second one for overlapping tasks. The second query is joined into the first…
The query that determines overlapping tasks is making two different Query objects: the first one for the main task and the second one for overlapping tasks. The second query is joined into the first one, injecting the second one's where clause as join condition, but that composition does not work if the second query has extra joins. Those extra joins come from related fields that may occur from the domain. The fix consists in recomposing the query with a join condition that does not depend on a dynamic domain, and injecting the domain in the where clause of the main query. With this strategy, the joins that appear because of the related fields in the domain are part of the main query, and are no longer lost by the composition. Note also that the test test_same_user_overlap_with_allocated_hours_less_than_workable_hours was actually broken, because the field allocated_hours wasn't flushed when doing the SQL query. The new query flushes the field, and the test has been fixed. odoo/odoo#207404
Manufacturing orders no longer automatically mark components or byproducts as picked just because the production quantity is changed. This keeps inventory consumption and byproduct production aligned with explicit user actions or final production completion, reducing unintended stock updates.
Original PR description
When the quantity being produced in a MO is updated, the consumption of components and the production of byproducts were automatically picked. However, this behavior should only occur when the user manually picks it or when the production is completed. This commit fixes the issue and updates some tests to reflect the intended behavior. task: 4314900