Commit de580bd6 by Administrator

Merge branch 'compteur-non-incremente-suite-deplacement-makeup-sur-shift' into 'dev_cooperatic'

template_created must be set to false to fully transform the shift registration…

See merge request !236
parents 16a0386b 88389f69
Pipeline #2891 failed with stage
in 1 minute 6 seconds
......@@ -314,7 +314,12 @@ class CagetteShift(models.Model):
fieldsDatas = { "related_shift_state":'open',
"state": 'open',
"is_makeup":data['is_makeup'],
"origin":canceled_res[0]['origin'] + ' reopened from memberspace' }
"origin":canceled_res[0]['origin'] + ' reopened from memberspace'}
"""In case shift to reopen is a makeup, we want the counter to be incremented once shift is done
That is why template_created must be set to false
However if shift to reopen is not a makeup, counter should not be incremented so template_created should not be changed."""
if data["is_makeup"]:
fieldsDatas["template_created"] = False
response = self.o_api.update('shift.registration', [shift_res['id']], fieldsDatas)
except Exception as e:
coop_logger.error("Reopen shift : %s", str(e))
......
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