Commit beada0b2 by François C.

Fix unsubscribed people in comitee shift search

parent 3522a711
Pipeline #1737 passed with stage
in 1 minute 36 seconds
...@@ -743,13 +743,14 @@ class CagetteMember(models.Model): ...@@ -743,13 +743,14 @@ class CagetteMember(models.Model):
keep_it = False keep_it = False
if not shift_id is None and len(shift_id) > 0: if not shift_id is None and len(shift_id) > 0:
# Only member registred to shift_id will be returned # Only member registred to shift_id will be returned
cond = [['id', '=', m['tmpl_reg_line_ids'][0]]] if len(m['tmpl_reg_line_ids']) > 0:
fields = ['shift_template_id'] cond = [['id', '=', m['tmpl_reg_line_ids'][0]]]
shift_templ_res = api.search_read('shift.template.registration.line', cond, fields) fields = ['shift_template_id']
if (len(shift_templ_res) > 0 shift_templ_res = api.search_read('shift.template.registration.line', cond, fields)
and if (len(shift_templ_res) > 0
int(shift_templ_res[0]['shift_template_id'][0]) == int(shift_id)): and
keep_it = True int(shift_templ_res[0]['shift_template_id'][0]) == int(shift_id)):
keep_it = True
else: else:
keep_it = True keep_it = True
if keep_it is True: if keep_it is True:
......
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