diff --git a/fieldservice_agreement/models/fsm_location.py b/fieldservice_agreement/models/fsm_location.py index d8127c93f4..7e7c258fe5 100644 --- a/fieldservice_agreement/models/fsm_location.py +++ b/fieldservice_agreement/models/fsm_location.py @@ -15,7 +15,7 @@ class FSMLocation(models.Model): def _compute_service_ids(self): for loc in self: agreements = self.env['agreement'].\ - search([('fsm_location_id', '=', self.name)]) + search([('fsm_location_id', '=', loc.id)]) ids = [] for agree in agreements: servpros = self.env['agreement.serviceprofile'].\ @@ -23,4 +23,4 @@ def _compute_service_ids(self): for ser in servpros: if ser.id not in ids: ids.append(ser.id) - self.serviceprofile_ids = ids + loc.serviceprofile_ids = ids