From d13f19aed9e70ac1c50185d21ac6220c87d56179 Mon Sep 17 00:00:00 2001 From: Fabien Bourgeois Date: Sun, 9 Oct 2016 12:47:08 +0200 Subject: [PATCH] [IMP]GOLEM Session Activity Registration : let removal of already canceled registrations happen --- .../models/golem_activity_session_registration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/golem_activity_session_registration/models/golem_activity_session_registration.py b/golem_activity_session_registration/models/golem_activity_session_registration.py index 4c78c63..2525a90 100644 --- a/golem_activity_session_registration/models/golem_activity_session_registration.py +++ b/golem_activity_session_registration/models/golem_activity_session_registration.py @@ -53,13 +53,13 @@ class GolemMember(models.Model): for r in rids: # == 2 is removal case r_removed.append(r) if r[0] == 2 else r_keep.append(r) rObj = self.env['golem.activity.session.registration'] - for r in r_removed: - r = rObj.browse([r[1]]) + for rem in r_removed: + r = rObj.browse([rem[1]]) # if already canceled, let it be removed, else cancel it if r.state != 'canceled': r.state = 'canceled' else: - r_keep.append(r) + r_keep.append(rem) values['activity_session_registration_ids'] = r_keep return super(GolemMember, self).write(values)