Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Maintenance

Entity: maintenance.request

Compute Method: _compute_duration

View 17.0 View 20.0
Inputs Method Outputs
  • schedule_date
  • schedule_end
+ for request in self:
+             if request.schedule_date and request.schedule_end:
+                 duration = (request.schedule_end - request.schedule_date).total_seconds() / 3600
+                 request.duration = round(duration, 2)
+             else:
+                 request.duration = 0
  • duration

Back to entity