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.
24 lines
665 B
Python
24 lines
665 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
{
|
|
'name': 'Equipments',
|
|
'version': '1.0',
|
|
'sequence': 125,
|
|
'category': 'Human Resources',
|
|
'description': """
|
|
Track equipment and manage maintenance requests.""",
|
|
'depends': ['mail'],
|
|
'summary': 'Equipments, Assets, Internal Hardware, Allocation Tracking',
|
|
'data': [
|
|
'security/maintenance.xml',
|
|
'security/ir.model.access.csv',
|
|
'data/maintenance_data.xml',
|
|
'views/maintenance_views.xml',
|
|
'views/maintenance_templates.xml',
|
|
'data/maintenance_cron.xml',
|
|
],
|
|
'demo': ['data/maintenance_demo.xml'],
|
|
'installable': True,
|
|
'application': True,
|
|
}
|