https://community.openproject.org/wp/57990
The code to create the temporary table in common between the migration
and the job to update status and % complete values. It has recently
changed to get the `excluded_from_totals` value from the `statuses`
table, but this field has been created in 14.2, and does not exist yet
in 14.0 when this migration is run.
This commit adds the previous version of the code to create the
temporary table, that does not require the `excluded_from_totals` field.
It also avoids creating the depths table which is not necessary in this
case.
https://community.openproject.org/wp/57990
In 14.0, Work and Remaining work were deemed more important than
% Complete. Now in 14.6, as % Complete becomes editable and more
important, we want to preserve it over Remaining work for users having
not yet migrated to version 14.0.
If a work package has only remaining work being set and progress
calculation mode is changed from work-based to status-based, then work
package gets a % complete value.
Remaining work and % complete being both present, work has to be
derived.
There was a bug in the way the excluded work packages were affecting the
query which updates the totals, especially regarding looking at the
`MAX(generations)` value. When considering work packages after filtering
out excluded work packages, the parent is alone, and its
`MAX(generations)` is 0, which is interpreted like it is a leaf work
package and leading to totals being unset, which is not correct.
Now the check for `MAX(generations) > 0` is done outside of the
filtering to prevent this bug from happening.
The job has been updated to excluded work packages having a status with
`excluded_from_totals` set to true. The journal entry has valid values
so that the cause renders correctly.
The job is not yet triggered properly when the "excluded from totals"
attribute of a status is changed in the administration.
https://community.openproject.org/wp/54646
A concurrency key has been set on all jobs updating progress values to
ensure that only one job is performed at a time.
All classes related to managing progress updates in jobs has been moved
to a specific folder.