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

Module: Field Service

Entity: fsm.order

Compute Method: _compute_duration

View 17.0 View 19.0
Inputs Method Outputs
  • date_start
  • date_end
+ for rec in self:
+             duration = 0.0
+             if rec.date_start and rec.date_end:
+                 start = fields.Datetime.from_string(rec.date_start)
+                 end = fields.Datetime.from_string(rec.date_end)
+                 delta = end - start
+                 duration = delta.total_seconds() / 3600
+             rec.duration = duration
  • duration

Back to entity