09/02/24 - 22hqsdsq

master
cherif 2024-02-10 22:17:11 +01:00
parent 9a4549015c
commit 0ed0493ea8
4 changed files with 1533 additions and 21 deletions

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="08/02/2024 -20h"> <list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="09/02/24 - 22h">
<change afterPath="$PROJECT_DIR$/site_formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/crm_opportunite.py" beforeDir="false" afterPath="$PROJECT_DIR$/crm_opportunite.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/site_formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/site_formation.py" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -76,13 +75,6 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1680804787304</updated> <updated>1680804787304</updated>
</task> </task>
<task id="LOCAL-00168" summary="12/12/2023 - 22h30">
<created>1702419422030</created>
<option name="number" value="00168" />
<option name="presentableId" value="LOCAL-00168" />
<option name="project" value="LOCAL" />
<updated>1702419422031</updated>
</task>
<task id="LOCAL-00169" summary="13/12/2023 - 23h30"> <task id="LOCAL-00169" summary="13/12/2023 - 23h30">
<created>1702506480594</created> <created>1702506480594</created>
<option name="number" value="00169" /> <option name="number" value="00169" />
@ -419,7 +411,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1707425449894</updated> <updated>1707425449894</updated>
</task> </task>
<option name="localTasksCounter" value="217" /> <task id="LOCAL-00217" summary="09/02/24 - 22h">
<created>1707512374459</created>
<option name="number" value="00217" />
<option name="presentableId" value="LOCAL-00217" />
<option name="project" value="LOCAL" />
<updated>1707512374460</updated>
</task>
<option name="localTasksCounter" value="218" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
@ -434,7 +433,6 @@
</option> </option>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="08/01/24 - 22h30" />
<MESSAGE value="09/01/24 - 19h30" /> <MESSAGE value="09/01/24 - 19h30" />
<MESSAGE value="11/01/24 - 21h30" /> <MESSAGE value="11/01/24 - 21h30" />
<MESSAGE value="12/01/24 - 16h30" /> <MESSAGE value="12/01/24 - 16h30" />
@ -459,6 +457,7 @@
<MESSAGE value="05/02/2024 -23h" /> <MESSAGE value="05/02/2024 -23h" />
<MESSAGE value="06/02/2024 -20h" /> <MESSAGE value="06/02/2024 -20h" />
<MESSAGE value="08/02/2024 -20h" /> <MESSAGE value="08/02/2024 -20h" />
<option name="LAST_COMMIT_MESSAGE" value="08/02/2024 -20h" /> <MESSAGE value="09/02/24 - 22h" />
<option name="LAST_COMMIT_MESSAGE" value="09/02/24 - 22h" />
</component> </component>
</project> </project>

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,7 @@ def Add_Update_SessionFormation(diction):
'class_internal_url', 'session_status', 'date_debut_inscription', 'date_fin_inscription', 'class_internal_url', 'session_status', 'date_debut_inscription', 'date_fin_inscription',
'attestation_certif', "distantiel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code', 'attestation_certif', "distantiel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
'session_ondemande', 'source', 'session_id', 'session_etape', 'pays', 'formateur_id', 'session_ondemande', 'source', 'session_id', 'session_etape', 'pays', 'formateur_id',
'titre', 'location_type', 'is_bpf'] 'titre', 'location_type', 'is_bpf', 'site_formation_id']
incom_keys = diction.keys() incom_keys = diction.keys()
for val in incom_keys: for val in incom_keys:
@ -106,6 +106,7 @@ def Add_Update_SessionFormation(diction):
session_id = diction['session_id'] session_id = diction['session_id']
code_session = "" code_session = ""
if ("code_session" in diction.keys()): if ("code_session" in diction.keys()):
mydata['code_session'] = diction['code_session'] mydata['code_session'] = diction['code_session']
@ -189,6 +190,13 @@ def Add_Update_SessionFormation(diction):
else: else:
mydata['titre'] = "" mydata['titre'] = ""
if ("site_formation_id" in diction.keys()):
mydata['site_formation_id'] = diction['site_formation_id']
else:
mydata['site_formation_id'] = ""
if ("location_type" in diction.keys()): if ("location_type" in diction.keys()):
mydata['location_type'] = str(diction['location_type']).lower() mydata['location_type'] = str(diction['location_type']).lower()
if (str(diction['location_type']).lower() not in MYSY_GV.TRAINING_LOCATION_TYPE): if (str(diction['location_type']).lower() not in MYSY_GV.TRAINING_LOCATION_TYPE):
@ -554,7 +562,7 @@ def GetSessionFormation(diction):
if val not in field_list and val.startswith('my_') is False: if val not in field_list and val.startswith('my_') is False:
mycommon.myprint(str(inspect.stack()[0][ mycommon.myprint(str(inspect.stack()[0][
3]) + " - Le champ '" + val + "' n'est pas autorisé, Creation partenaire annulée") 3]) + " - Le champ '" + val + "' n'est pas autorisé, Creation partenaire annulée")
return False, "de récupérer la liste des stagiaires . Toutes les informations fournies ne sont pas valables" return False, "Toutes les informations fournies ne sont pas valables"
""" """
Verification de la liste des champs obligatoires Verification de la liste des champs obligatoires
@ -564,7 +572,7 @@ def GetSessionFormation(diction):
if val not in diction: if val not in diction:
mycommon.myprint( mycommon.myprint(
str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ") str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ")
return False, "Impossible de récupérer la liste des stagiaires, Toutes les informations necessaires n'ont pas été fournies" return False, "Toutes les informations necessaires n'ont pas été fournies"
# Recuperation du recid du partner # Recuperation du recid du partner
mydata = {} mydata = {}
@ -657,6 +665,22 @@ def GetSessionFormation(diction):
user['formateur_nom_prenom'] = formateur_nom_prenom user['formateur_nom_prenom'] = formateur_nom_prenom
site_formation_id = ""
site_formation_code = ""
if("site_formation_id" in retval.keys() and retval['site_formation_id']) :
site_formation_data = MYSY_GV.dbname['site_formation'].find_one({'_id':ObjectId(str(retval['site_formation_id'])),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])})
if( site_formation_data and "code_site" in site_formation_data.keys() ):
site_formation_code = site_formation_data['code_site']
site_formation_id = str(retval['site_formation_id'])
user['site_formation_id'] = site_formation_id
user['site_formation_code'] = site_formation_code
#print(" ### user = ", user) #print(" ### user = ", user)
RetObject.append(mycommon.JSONEncoder().encode(user)) RetObject.append(mycommon.JSONEncoder().encode(user))
@ -883,8 +907,6 @@ def GetActiveSessionFormation_List(diction):
if( str(local_tmp['session_ondemande']).strip() == "1"): if( str(local_tmp['session_ondemande']).strip() == "1"):
RetObject.append(mycommon.JSONEncoder().encode(retval)) RetObject.append(mycommon.JSONEncoder().encode(retval))
#print("#### GetActiveSessionFormation_List RetObject = "+str(RetObject)) #print("#### GetActiveSessionFormation_List RetObject = "+str(RetObject))
return True, RetObject return True, RetObject
@ -1157,6 +1179,21 @@ def GetAllValideSessionPartner_List(diction):
val['distantiel'] = retVal['distantiel'] val['distantiel'] = retVal['distantiel']
site_formation_id = ""
site_formation_code = ""
if ("site_formation_id" in retVal.keys() and retVal['site_formation_id']):
site_formation_data = MYSY_GV.dbname['site_formation'].find_one(
{'_id': ObjectId(str(retVal['site_formation_id'])),
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])})
if (site_formation_data and "code_site" in site_formation_data.keys()):
site_formation_code = site_formation_data['code_site']
site_formation_id = str(retVal['site_formation_id'])
val['site_formation_id'] = site_formation_id
val['site_formation_code'] = site_formation_code
if ("formateur_id" in retVal.keys() and retVal['formateur_id']): if ("formateur_id" in retVal.keys() and retVal['formateur_id']):
val['formateur_id'] = retVal['formateur_id'] val['formateur_id'] = retVal['formateur_id']
@ -1399,6 +1436,23 @@ def GetAllValideSessionPartner_List_filter_like(diction):
else: else:
val['distantiel'] = "0" val['distantiel'] = "0"
site_formation_id = ""
site_formation_code = ""
if ("site_formation_id" in retVal.keys() and retVal['site_formation_id']):
site_formation_data = MYSY_GV.dbname['site_formation'].find_one(
{'_id': ObjectId(str(retVal['site_formation_id'])),
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])})
if (site_formation_data and "code_site" in site_formation_data.keys()):
site_formation_code = site_formation_data['code_site']
site_formation_id = str(retVal['site_formation_id'])
val['site_formation_id'] = site_formation_id
val['site_formation_code'] = site_formation_code
if ("formateur_id" in retVal.keys() and retVal['formateur_id']): if ("formateur_id" in retVal.keys() and retVal['formateur_id']):
val['formateur_id'] = retVal['formateur_id'] val['formateur_id'] = retVal['formateur_id']

View File

@ -224,14 +224,21 @@ def Update_Site_Formation(diction):
mydata['date_update'] = str(datetime.now()) mydata['date_update'] = str(datetime.now())
mydata['update_by'] = str(my_partner['_id']) mydata['update_by'] = str(my_partner['_id'])
result = MYSY_GV.dbname['crm_opportunite'].find_one_and_update( print(" ### mydata = ", mydata)
qry = {'_id': ObjectId(str(my_site_id)),
'partner_owner_recid': str(my_partner['recid'])}
print(" ### qry = ", qry)
result = MYSY_GV.dbname['site_formation'].find_one_and_update(
{'_id': ObjectId(str(my_site_id)), {'_id': ObjectId(str(my_site_id)),
'partner_owner_recid': str(my_partner['recid'])}, 'partner_owner_recid': str(my_partner['recid'])},
{"$set": mydata}, {"$set": mydata},
upsert=False, upsert=False,
return_document=ReturnDocument.AFTER return_document=ReturnDocument.AFTER
) )
if ("_id" not in result.keys()): if (result is None or "_id" not in result.keys()):
mycommon.myprint( mycommon.myprint(
" Impossible de mettre à jour le site de formation (2) ") " Impossible de mettre à jour le site de formation (2) ")
return False, " Impossible de mettre à jour le site de formation (2) " return False, " Impossible de mettre à jour le site de formation (2) "