Commit 261f5acd by Yvon Kerdoncuff

use list instead of one id as there may be several shift_templates associated to one res_partner

parent dfbddd07
...@@ -1088,17 +1088,17 @@ class CagetteMember(models.Model): ...@@ -1088,17 +1088,17 @@ class CagetteMember(models.Model):
return makeup_reg_ids return makeup_reg_ids
def get_shift_template_registration_id(self): def get_shift_template_registration_ids(self):
c = [['partner_id', '=', self.id], ['active', '=', True]] c = [['partner_id', '=', self.id]]
f = ['id'] f = ['id']
return self.o_api.search_read("shift.template.registration", c, f)[0]['id'] return self.o_api.search_read("shift.template.registration", c, f)
def unsubscribe_member_but_exogenous_makeups(self): def unsubscribe_member_but_exogenous_makeups(self):
return self.o_api.execute( return self.o_api.execute(
'shift.template.registration', 'shift.template.registration',
'unlink_but_exogenous_makeups', 'unlink_but_exogenous_makeups',
[self.get_shift_template_registration_id()] [self.get_shift_template_registration_ids()]
) )
...@@ -1106,7 +1106,7 @@ class CagetteMember(models.Model): ...@@ -1106,7 +1106,7 @@ class CagetteMember(models.Model):
return self.o_api.execute( return self.o_api.execute(
'shift.template.registration', 'shift.template.registration',
'unlink', 'unlink',
[self.get_shift_template_registration_id()] [self.get_shift_template_registration_ids()]
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment