Commit 2a6dd52c by Yvon Kerdoncuff

properly set origin in set_shift

parent 8e1fb25c
...@@ -936,7 +936,8 @@ def handle_suppleant_scheduled_makeups_on_pairing(parent_id, child, child_schedu ...@@ -936,7 +936,8 @@ def handle_suppleant_scheduled_makeups_on_pairing(parent_id, child, child_schedu
'idPartner': parent_id, 'idPartner': parent_id,
'idShift': child_scheduled_makeup['shift_id'][0], 'idShift': child_scheduled_makeup['shift_id'][0],
'shift_type': 'standard', 'shift_type': 'standard',
'is_makeup': True 'is_makeup': True,
'origin': 'Transfert d\'un rattrapage sur le titulaire à la création de binôme'
} }
cs.set_shift(data) # Automaticaly decrements makeups_to_do to preserve total count. cs.set_shift(data) # Automaticaly decrements makeups_to_do to preserve total count.
parent_scheduled_makeups_length = parent_scheduled_makeups_length + 1 parent_scheduled_makeups_length = parent_scheduled_makeups_length + 1
......
...@@ -303,6 +303,7 @@ class CagetteShift(models.Model): ...@@ -303,6 +303,7 @@ class CagetteShift(models.Model):
- idShift - idShift
- shift_type - shift_type
- is_makeup - is_makeup
- origin
""" """
st_r_id = False st_r_id = False
try: try:
...@@ -313,7 +314,7 @@ class CagetteShift(models.Model): ...@@ -313,7 +314,7 @@ class CagetteShift(models.Model):
"shift_id": data['idShift'], "shift_id": data['idShift'],
"shift_ticket_id": self.get_shift_ticket(data['idShift'], data['shift_type']), "shift_ticket_id": self.get_shift_ticket(data['idShift'], data['shift_type']),
"shift_type": shift_type, "shift_type": shift_type,
"origin": 'memberspace', "origin": data['origin'],
"is_makeup": data['is_makeup'], "is_makeup": data['is_makeup'],
"state": 'open'} "state": 'open'}
if (shift_type == "standard" and data['is_makeup'] is not True) or shift_type == "ftop": if (shift_type == "standard" and data['is_makeup'] is not True) or shift_type == "ftop":
...@@ -405,7 +406,7 @@ class CagetteShift(models.Model): ...@@ -405,7 +406,7 @@ class CagetteShift(models.Model):
fieldsDatas = { "related_shift_state":'open', fieldsDatas = { "related_shift_state":'open',
"state": 'open', "state": 'open',
"is_makeup":data['is_makeup'], "is_makeup":data['is_makeup'],
"origin":canceled_res[0]['origin'] + ' reopened from memberspace'} "origin":canceled_res[0]['origin'] + ' reopened ' + data['origin']}
#following code is required to properly set template_created. #following code is required to properly set template_created.
#TODO : factor with set_shift code #TODO : factor with set_shift code
......
...@@ -196,7 +196,8 @@ def change_shift(request): ...@@ -196,7 +196,8 @@ def change_shift(request):
"idPartner": int(request.POST['idPartner']), "idPartner": int(request.POST['idPartner']),
"idShift": int(request.POST['idNewShift']), "idShift": int(request.POST['idNewShift']),
"shift_type": request.POST['shift_type'], "shift_type": request.POST['shift_type'],
"is_makeup": cs.shift_is_makeup(listRegister[0]) "is_makeup": cs.shift_is_makeup(listRegister[0]),
"origin": "Espace membre : changement de service"
} }
should_block_service_exchange = getattr(settings, 'BLOCK_SERVICE_EXCHANGE_24H_BEFORE', False) should_block_service_exchange = getattr(settings, 'BLOCK_SERVICE_EXCHANGE_24H_BEFORE', False)
...@@ -289,11 +290,13 @@ def add_shift(request): ...@@ -289,11 +290,13 @@ def add_shift(request):
"idPartner": partner_id, "idPartner": partner_id,
"idShift": id_shift, "idShift": id_shift,
"shift_type": request.POST['shift_type'], "shift_type": request.POST['shift_type'],
"is_makeup": False "is_makeup": False,
"origin": "Espace membre : ajout de service"
} }
if 'is_makeup' in request.POST and request.POST['is_makeup'] == "1": if 'is_makeup' in request.POST and request.POST['is_makeup'] == "1":
data['is_makeup'] = True data['is_makeup'] = True
data['origin'] = "Espace membre : sélection de rattrapage"
if request.POST['shift_type'] == "ftop": if request.POST['shift_type'] == "ftop":
if cs.is_matching_ftop_rules(partner_id, id_shift) is True: if cs.is_matching_ftop_rules(partner_id, id_shift) 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