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"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="08/02/2024 -20h">
<change afterPath="$PROJECT_DIR$/site_formation.py" afterDir="false" />
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="09/02/24 - 22h">
<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$/crm_opportunite.py" beforeDir="false" afterPath="$PROJECT_DIR$/crm_opportunite.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/site_formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/site_formation.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-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">
<created>1702506480594</created>
<option name="number" value="00169" />
@ -419,7 +411,14 @@
<option name="project" value="LOCAL" />
<updated>1707425449894</updated>
</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 />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -434,7 +433,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="08/01/24 - 22h30" />
<MESSAGE value="09/01/24 - 19h30" />
<MESSAGE value="11/01/24 - 21h30" />
<MESSAGE value="12/01/24 - 16h30" />
@ -459,6 +457,7 @@
<MESSAGE value="05/02/2024 -23h" />
<MESSAGE value="06/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>
</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',
'attestation_certif', "distantiel", "presentiel", "prix_session", 'contenu_ftion', 'lms_class_code',
'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()
for val in incom_keys:
@ -106,6 +106,7 @@ def Add_Update_SessionFormation(diction):
session_id = diction['session_id']
code_session = ""
if ("code_session" in diction.keys()):
mydata['code_session'] = diction['code_session']
@ -189,6 +190,13 @@ def Add_Update_SessionFormation(diction):
else:
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()):
mydata['location_type'] = str(diction['location_type']).lower()
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:
mycommon.myprint(str(inspect.stack()[0][
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
@ -564,7 +572,7 @@ def GetSessionFormation(diction):
if val not in diction:
mycommon.myprint(
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
mydata = {}
@ -657,6 +665,22 @@ def GetSessionFormation(diction):
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)
RetObject.append(mycommon.JSONEncoder().encode(user))
@ -883,8 +907,6 @@ def GetActiveSessionFormation_List(diction):
if( str(local_tmp['session_ondemande']).strip() == "1"):
RetObject.append(mycommon.JSONEncoder().encode(retval))
#print("#### GetActiveSessionFormation_List RetObject = "+str(RetObject))
return True, RetObject
@ -1157,6 +1179,21 @@ def GetAllValideSessionPartner_List(diction):
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']):
val['formateur_id'] = retVal['formateur_id']
@ -1399,6 +1436,23 @@ def GetAllValideSessionPartner_List_filter_like(diction):
else:
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']):
val['formateur_id'] = retVal['formateur_id']

View File

@ -224,14 +224,21 @@ def Update_Site_Formation(diction):
mydata['date_update'] = str(datetime.now())
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)),
'partner_owner_recid': str(my_partner['recid'])},
{"$set": mydata},
upsert=False,
return_document=ReturnDocument.AFTER
)
if ("_id" not in result.keys()):
if (result is None or "_id" not in result.keys()):
mycommon.myprint(
" Impossible de mettre à jour le site de formation (2) ")
return False, " Impossible de mettre à jour le site de formation (2) "