When you define recurring maintenance requests on an equipment, the
maintenance duration and the maintenance team is not set on the created
requests.
The problem comes from the creation method called by the cron that
doesn't use the duration and maintenance team to create new requests.
We now use these fields in the request creation
The xml file with the cron that creates the recurrent
preventive requests was not loaded in the system, so we needed to add
it.
Before, the cron was foreseen to only create the maintenance request on
the day that the request was foreseen (in the morning). Now, it will
create a request if none exists on the next_action_date. That way the
requests can be planned for.
The other problem is that the '_compute_next_maintenance' method
for calculating the next_action_date does not take into account
the possibly manually already created requests. So, now, the next
maintenance is calculated with the closed requests and the open ones.
If the first new one is in the past, it takes that date in the past. If it is in
the future, it will see if the gap is big enough to put a maintenance
in between the last done maintenance (or now) and the first new one.
If none exists, it is today + period.
That's why we have to add the 'request_date' in the depends. And take
into account the preventive requests existing on an equipment.
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:
- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
translated
The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).
Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).
This commit correct all the external ids tagged as from base or other incorrect
modules.
- rename models from hr.equipment.something to maintenance.something
- add concept of maintenance team and dashboard
- remove generic alias for maintenance
hr_equipment module is renamed to maintenance. No change is performed to the
module itself. It prepares further changes, mainly splitting maintenance from
hr_maintenance.