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

Module: Maintenance Location

Entity: maintenance.request

Compute Method: _compute_location_id

View 17.0 View 18.0
Inputs Method Outputs
  • equipment_id
  • equipment_id.location_id
  • stage_id
  • stage_id.done
for record in self:
            if record.equipment_id and record.equipment_id.location_id:
-                 record.location_id = record.equipment_id.location_id
+                 if record.stage_id and record.stage_id.done:
+                     # if the request is done, we want keep existing location
+                     pass
+                 else:
+                     record.location_id = record.equipment_id.location_id
+             else:
+                 record.location_id = False
  • location_id

Back to entity