master
cherif 2023-11-25 23:36:43 +01:00
parent dab50014a3
commit 48b484860b
4 changed files with 1953 additions and 23 deletions

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="23/11/2023 - 21h30">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="24/11/2023 - 18h30">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_order.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_order.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -76,13 +75,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00109" summary="22/09/2023 - 18h53">
<created>1695401442385</created>
<option name="number" value="00109" />
<option name="presentableId" value="LOCAL-00109" />
<option name="project" value="LOCAL" />
<updated>1695401442386</updated>
</task>
<task id="LOCAL-00110" summary="25/09/2023 - 12h40">
<created>1695638525925</created>
<option name="number" value="00110" />
@ -419,7 +411,14 @@
<option name="project" value="LOCAL" />
<updated>1700772203291</updated>
</task>
<option name="localTasksCounter" value="158" />
<task id="LOCAL-00158" summary="24/11/2023 - 18h30">
<created>1700846519563</created>
<option name="number" value="00158" />
<option name="presentableId" value="LOCAL-00158" />
<option name="project" value="LOCAL" />
<updated>1700846519569</updated>
</task>
<option name="localTasksCounter" value="159" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -434,7 +433,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="zzz" />
<MESSAGE value="22/10/2023 - 12h" />
<MESSAGE value="22/10/2023 - 18h00" />
<MESSAGE value="22/10/2023 - 22h" />
@ -459,6 +457,7 @@
<MESSAGE value="22/11/2023 - 23h00" />
<MESSAGE value="23/11/23 - 13:30" />
<MESSAGE value="23/11/2023 - 21h30" />
<option name="LAST_COMMIT_MESSAGE" value="23/11/2023 - 21h30" />
<MESSAGE value="24/11/2023 - 18h30" />
<option name="LAST_COMMIT_MESSAGE" value="24/11/2023 - 18h30" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -413,17 +413,17 @@ def Create_Automatic_Sequence(diction):
for single_date in mycommon.daterange(date_debut_session, date_fin_session):
print(single_date.strftime("%Y-%m-%d"))
print(single_date.strftime("%A"))
#print(single_date.strftime("%Y-%m-%d"))
#print(single_date.strftime("%A"))
print(" Les date off sont : ", is_existe_valide_journee_model_data['date_off'])
#print(" Les date off sont : ", is_existe_valide_journee_model_data['date_off'])
date_jour = str(single_date.strftime("%Y-%m-%d"))
jour_name = single_date.strftime("%A")
# Recuperation des sequences associées à jour_name
jours_name_list_sequence = is_existe_valide_journee_model_data[jour_name]["tab_sequence"]
print(" ### les sequences du ", jour_name, " sont ", jours_name_list_sequence)
#print(" ### les sequences du ", jour_name, " sont ", jours_name_list_sequence)
# Pour chaque sequence de la journée
if (date_jour not in is_existe_valide_journee_model_data['date_off']):
for local_val in jours_name_list_sequence :
@ -1054,6 +1054,8 @@ def Add_Sequence_Affectation_Ressource_Poste(diction):
if( inserted_data is None):
return False," Impossible d'affecter la ressource à la sequence (2)"
print(" ### inserted_data = ", inserted_data)
"""
A présent que la sequence est créée, creation de l'event dans l'agenda de la ressource
@ -1072,6 +1074,9 @@ def Add_Sequence_Affectation_Ressource_Poste(diction):
data_agenda['related_collection_recid'] = str(related_target_collection_id)
data_agenda['partner_owner_recid'] = str(partner_recid)
data_agenda['event_title'] = str(class_title)
data_agenda['session_formation_sequence_affectation_id'] = str(inserted_data.inserted_id)
data_agenda['comment'] = str(session_data['code_session'])
data_agenda['event_start'] = datetime.strptime(str(sequence_session_existe_data['sequence_start']), '%d/%m/%Y %H:%M').isoformat()
@ -1435,11 +1440,12 @@ def Delete_Sequence_Affectation_Ressource_Poste(diction):
"""
A present que la ressource a été supprimée, il faut egalement supprimer la reservation de la ressource
"""
qry_for_delete = {'sequence_session_id':str(diction['_id']), 'partner_owner_recid': str(affectation_sequence_session_data['partner_owner_recid']),
qry_for_delete = {'sequence_session_id':str(affectation_sequence_session_data['sequence_session_id']), 'partner_owner_recid': str(affectation_sequence_session_data['partner_owner_recid']),
'related_collection_recid':str(affectation_sequence_session_data['related_target_collection_id']),
'related_target_collection':str(affectation_sequence_session_data['related_target_collection']),}
'related_collection':str(affectation_sequence_session_data['related_target_collection']),
'session_formation_sequence_affectation_id': str(affectation_sequence_session_data['_id'])}
#print(" #### qry_for_delete = ", qry_for_delete)
print(" #### qry_for_delete = ", qry_for_delete)
MYSY_GV.dbname['agenda'].delete_many(qry_for_delete)
@ -1491,7 +1497,7 @@ def Get_List_Sequence_Ressource_Affectation(diction):
'valide':'1', 'locked':'0'}
print(" ### qry_affectation = ",qry_affectation)
#print(" ### qry_affectation = ",qry_affectation)
RetObject = []
val_tmp = 1

View File

@ -282,6 +282,7 @@ def CreateTableauEmargement_From_Sequence(diction):
adresse = ""
qry = {"_id":ObjectId(str(session_id)), "valide": "1", 'partner_owner_recid':str(partner_recid)}
# Verifier que la session existe
session_formation_count = MYSY_GV.dbname['session_formation'].count_documents(qry)
if( session_formation_count <= 0 ):
mycommon.myprint(
@ -291,6 +292,18 @@ def CreateTableauEmargement_From_Sequence(diction):
session_data = MYSY_GV.dbname['session_formation'].find_one({"_id":ObjectId(str(session_id)), "valide": "1"})
# Verifier qu'on a bien des sequences valides pour cette session de formation
is_existe_sequence_session_valide_count = MYSY_GV.dbname['session_formation_sequence'].count_documents({'session_id':str(diction['session_id']),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(partner_recid)})
if( is_existe_sequence_session_valide_count <= 0):
mycommon.myprint(
str(inspect.stack()[0][3]) + " - Aucune sequence valide pour cette session de formation ")
return False, "Aucune sequence valide pour cette session de formation "
# Recuperation de la liste des sequences associées à la session
@ -373,11 +386,11 @@ def CreateTableauEmargement_From_Sequence(diction):
return True, "ok"
return True, " Le tableau d'émargement a été correctement initialisé "
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, "Impossible de créer le tableau d'emargement"
return False, "Impossible initialiser de créer le tableau d'émargement "
"""