23/10/2023 - 13h
parent
5680b69aa2
commit
6b6618476c
|
@ -1,11 +1,12 @@
|
|||
<?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="22/10/2023 - 18h00">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="22/10/2023 - 22h">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" 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$/base_specific_fields.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_specific_fields.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -75,13 +76,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00086" summary="27/08/23 - 22h">
|
||||
<created>1693168933560</created>
|
||||
<option name="number" value="00086" />
|
||||
<option name="presentableId" value="LOCAL-00086" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1693168933560</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00087" summary="28/08/23 - 13h30">
|
||||
<created>1693222908723</created>
|
||||
<option name="number" value="00087" />
|
||||
|
@ -418,7 +412,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1697992615134</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="135" />
|
||||
<task id="LOCAL-00135" summary="22/10/2023 - 22h">
|
||||
<created>1698005958434</created>
|
||||
<option name="number" value="00135" />
|
||||
<option name="presentableId" value="LOCAL-00135" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1698005958435</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="136" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -433,7 +434,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="22/09/2023 - 12h53" />
|
||||
<MESSAGE value="22/09/2023 - 18h53" />
|
||||
<MESSAGE value="25/09/2023 - 12h40" />
|
||||
<MESSAGE value="25/09/2023 - 16h40" />
|
||||
|
@ -458,6 +458,7 @@
|
|||
<MESSAGE value="zzz" />
|
||||
<MESSAGE value="22/10/2023 - 12h" />
|
||||
<MESSAGE value="22/10/2023 - 18h00" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="22/10/2023 - 18h00" />
|
||||
<MESSAGE value="22/10/2023 - 22h" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="22/10/2023 - 22h" />
|
||||
</component>
|
||||
</project>
|
1164
Log/log_file.log
1164
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -83,8 +83,8 @@ def Add_specific_field(diction):
|
|||
"""
|
||||
data = {}
|
||||
data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data['valide'] = str(my_partner['recid'])
|
||||
data['locked'] = str(my_partner['recid'])
|
||||
data['valide'] = "1"
|
||||
data['locked'] = "0"
|
||||
data['date_update'] = str(datetime.now())
|
||||
data['field_value'] = ""
|
||||
|
||||
|
@ -203,7 +203,10 @@ def Add_specific_field(diction):
|
|||
|
||||
|
||||
"""
|
||||
Modification d'un champ spécifique
|
||||
Modification d'un champ spécifique.
|
||||
|
||||
/!\ : on ne peut pas modifier le nom technique d'un champ deja utilisé
|
||||
la requete de controle est : { "mon_champs" : { $exists : true, $ne: "" } }, si existe alors PAS de modification du nom technique
|
||||
"""
|
||||
def Update_specific_field(diction):
|
||||
try:
|
||||
|
@ -221,7 +224,8 @@ def Update_specific_field(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['_id', 'token']
|
||||
field_list_obligatoire = ['related_collection', 'field_type', 'is_mandatory', 'field_name',
|
||||
'_id', 'token']
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
|
@ -243,13 +247,48 @@ def Update_specific_field(diction):
|
|||
if (local_status is not True):
|
||||
return local_status, my_partner, False
|
||||
|
||||
# Verification si l'_id existe et est valide
|
||||
specific_field_data = MYSY_GV.dbname['base_specific_fields'].find_one({'_id': ObjectId(str(diction['_id'])), 'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide': '1',})
|
||||
|
||||
if( specific_field_data is None):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " -Impossible d'identifier le document à mettre à jour ")
|
||||
return False, " Impossible d'identifier le document à mettre à jour",
|
||||
|
||||
|
||||
|
||||
# Verification s'il y a eu modification du nom technique du champ
|
||||
is_importante_field_changed = False
|
||||
|
||||
if( str( diction['field_name']) != str(specific_field_data['field_name'])):
|
||||
is_importante_field_changed = True
|
||||
|
||||
if (str(diction['related_collection']) != str(specific_field_data['related_collection'])):
|
||||
is_importante_field_changed = True
|
||||
|
||||
if (str(diction['field_type']) != str(specific_field_data['field_type'])):
|
||||
is_importante_field_changed = True
|
||||
|
||||
if( is_importante_field_changed is True ):
|
||||
local_qry = {str(specific_field_data['field_name']): {'$exists': True, '$ne': ""}}
|
||||
|
||||
is_record_exist_count = MYSY_GV.dbname[str(specific_field_data['related_collection'])].count_documents(
|
||||
local_qry)
|
||||
|
||||
if (is_record_exist_count > 0):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ est déjà utilisé, impossible de modifier le nom technique, le type et l'entité ")
|
||||
return False, "Le champ est déjà utilisé, impossible de modifier le nom technique, le type et l'entité",
|
||||
|
||||
|
||||
"""
|
||||
Recuperation des données fournies en entrée
|
||||
"""
|
||||
data = {}
|
||||
data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data['valide'] = str(my_partner['recid'])
|
||||
data['locked'] = str(my_partner['recid'])
|
||||
data['valide'] = "1"
|
||||
data['locked'] = "0"
|
||||
data['date_update'] = str(datetime.now())
|
||||
data['field_value'] = ""
|
||||
|
||||
|
@ -344,7 +383,7 @@ def Update_specific_field(diction):
|
|||
return False, "Cette personnalisation n'existe pas ",
|
||||
|
||||
ret_val2 = MYSY_GV.dbname['base_specific_fields'].find_one_and_update(
|
||||
{'_id': ObjectId(str(diction['_id'])),
|
||||
{'_id': ObjectId(str(diction['_id'])), 'partner_owner_recid':str(my_partner['recid']),
|
||||
'valide': '1',},
|
||||
{"$set": data},
|
||||
return_document=ReturnDocument.AFTER,
|
||||
|
@ -352,14 +391,6 @@ def Update_specific_field(diction):
|
|||
)
|
||||
|
||||
|
||||
inserted_id = ""
|
||||
inserted_id = MYSY_GV.dbname['base_specific_fields'].insert_one(data).inserted_id
|
||||
if (ret_val2 is None ):
|
||||
mycommon.myprint(
|
||||
" Impossible de mettre à jour le champ personnalisé ")
|
||||
return False, " Impossible de mettre à jour le champ personnalisé "
|
||||
|
||||
|
||||
return True, " Le champ personnalisé a été correctement mis à jour "
|
||||
|
||||
except Exception as e:
|
||||
|
@ -417,6 +448,7 @@ def get_given_specific_field(diction):
|
|||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
print(" ### data_cle = ", data_cle)
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
|
@ -424,6 +456,23 @@ def get_given_specific_field(diction):
|
|||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
if( str(retval['related_collection']) == "ressource_humaine"):
|
||||
user['related_collection_name'] = "Employe"
|
||||
|
||||
elif (str(retval['related_collection']) == "ressource_materielle"):
|
||||
user['related_collection_name'] = "Materiel"
|
||||
|
||||
elif (str(retval['related_collection']) == "session_formation"):
|
||||
user['related_collection_name'] = "Session"
|
||||
|
||||
elif (str(retval['related_collection']) == "myclass"):
|
||||
user['related_collection_name'] = "Formation"
|
||||
|
||||
elif (str(retval['related_collection']) == "inscription"):
|
||||
user['related_collection_name'] = "Inscription"
|
||||
|
||||
else :
|
||||
user['related_collection_name'] = user['related_collection']
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
@ -512,8 +561,8 @@ def delete_given_specific_field(diction):
|
|||
|
||||
if( is_record_exist_count > 0 ):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champs est déjà utilisé, impossible de le supprimer ")
|
||||
return False, "Le champs est déjà utilisé, impossible de le supprimer ",
|
||||
inspect.stack()[0][3]) + " Le champ est déjà utilisé, impossible de le supprimer ")
|
||||
return False, "Le champ est déjà utilisé, impossible de le supprimer ",
|
||||
|
||||
|
||||
MYSY_GV.dbname['base_specific_fields'].delete_one({'_id':ObjectId(str(diction['_id']))})
|
||||
|
@ -528,19 +577,19 @@ def delete_given_specific_field(diction):
|
|||
|
||||
|
||||
|
||||
|
||||
""""
|
||||
Recuperation de la liste des champs spécifique utilisable par un objet metier.
|
||||
il est important de ne prendre que ceux qui sont valide et avec is_displayed = 1
|
||||
car cette fonction est utilisée pour remplir les champs.
|
||||
"""
|
||||
Recuperation de liste des champs spécifiques d'un partenaire
|
||||
"""
|
||||
def get_list_specific_field_partner(diction):
|
||||
def Get_Partner_Object_Specific_Valide_Displayed_Fields(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'object_name']
|
||||
field_list = ['token', ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -552,7 +601,7 @@ def get_list_specific_field_partner(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'object_name']
|
||||
field_list_obligatoire = ['token', ]
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
@ -574,7 +623,6 @@ def get_list_specific_field_partner(diction):
|
|||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['is_displayed'] = "1"
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
|
@ -599,6 +647,160 @@ def get_list_specific_field_partner(diction):
|
|||
return False, " Impossible de récuperer la liste des champs personnalisés "
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de liste des champs spécifiques d'un partenaire, sans aucun filter
|
||||
"""
|
||||
def get_list_specific_field_partner_no_filter(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', ]
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
|
||||
# print(" ### qtry = ", data_cle)
|
||||
|
||||
for retval in MYSY_GV.dbname['base_specific_fields'].find(data_cle):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de récuperer la liste des champs personnalisés "
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de liste des champs spécifiques d'un partenaire, avec des filtres sur
|
||||
- objet metier
|
||||
- nom du champs
|
||||
"""
|
||||
def get_list_specific_field_partner_with_filter(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'object_name', 'field_name']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token',]
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
filt_object_name = {}
|
||||
if ("object_name" in diction.keys()):
|
||||
filt_object_name = {'related_collection': {'$regex': str(diction['object_name']), "$options": "i"}}
|
||||
|
||||
filt_field_name = {}
|
||||
if ("field_name" in diction.keys()):
|
||||
filt_field_name = {
|
||||
'field_name': {'$regex': str(diction['field_name']), "$options": "i"}}
|
||||
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 1
|
||||
|
||||
local_qry = {"$and":[ data_cle, filt_object_name, filt_field_name]}
|
||||
print(" ### get_list_specific_field_partner_with_filter local_qry = ", local_qry)
|
||||
|
||||
for retval in MYSY_GV.dbname['base_specific_fields'].find(local_qry):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de récuperer la liste des champs personnalisés "
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Recuperation de liste des champs spécifiques d'un objet (client, formation, etc) d'un partenaire
|
||||
"""
|
||||
|
@ -665,4 +867,32 @@ def get_list_specific_field_partner_by_object(diction):
|
|||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de récupérer la liste des champs spécifiques "
|
||||
return False, " Impossible de récupérer la liste des champs spécifiques "
|
||||
|
||||
|
||||
"""
|
||||
Fonction retourne la liste des collection eligibles à la creation de champs spécifique
|
||||
"""
|
||||
def Get_Collection_Eligible_Champ_Specific():
|
||||
try:
|
||||
RetObject = []
|
||||
|
||||
mycollection_field1 = {"objet_metier": 'ressource_humaine', "nom": 'Employe',}
|
||||
mycollection_field2 = {"objet_metier": 'ressource_materielle', "nom": 'Materiel',}
|
||||
mycollection_field3 = {"objet_metier": 'session_formation', "nom": 'Session', }
|
||||
mycollection_field4 = {"objet_metier": 'myclass', "nom": 'Formation', }
|
||||
mycollection_field5 = {"objet_metier": 'inscription', "nom": 'Inscription', }
|
||||
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(mycollection_field1))
|
||||
RetObject.append(mycommon.JSONEncoder().encode(mycollection_field2))
|
||||
RetObject.append(mycommon.JSONEncoder().encode(mycollection_field3))
|
||||
RetObject.append(mycommon.JSONEncoder().encode(mycollection_field4))
|
||||
RetObject.append(mycommon.JSONEncoder().encode(mycollection_field5))
|
||||
|
||||
return True, RetObject
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de récupérer la liste des object métiers éligibles pour les champs spécifiques"
|
||||
|
|
58
main.py
58
main.py
|
@ -5225,19 +5225,55 @@ def delete_given_specific_field():
|
|||
|
||||
|
||||
"""
|
||||
API de recuperation de liste des champs spécifique d'un partenaire
|
||||
API de recuperation de liste des champs spécifique d'un partenaire sans filtres.
|
||||
il est important de ne prendre que ceux qui sont valide et avec is_displayed = 1
|
||||
car cette fonction est utilisée pour remplir les champs.
|
||||
|
||||
"""
|
||||
@app.route('/myclass/api/get_list_specific_field_partner/', methods=['POST','GET'])
|
||||
@app.route('/myclass/api/Get_Partner_Object_Specific_Valide_Displayed_Fields/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def get_list_specific_field_partner():
|
||||
def Get_Partner_Object_Specific_Valide_Displayed_Fields():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### get_list_specific_field_partner : payload = ",payload)
|
||||
status, retval = base_specific_fields.get_list_specific_field_partner(payload)
|
||||
print(" ### Get_Partner_Object_Specific_Valide_Displayed_Fields : payload = ",payload)
|
||||
status, retval = base_specific_fields.Get_Partner_Object_Specific_Valide_Displayed_Fields(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation de liste des champs spécifique d'un partenaire sans filtres
|
||||
"""
|
||||
@app.route('/myclass/api/get_list_specific_field_partner_no_filter/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def get_list_specific_field_partner_no_filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### get_list_specific_field_partner_no_filter : payload = ",payload)
|
||||
status, retval = base_specific_fields.get_list_specific_field_partner_no_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation de liste des champs spécifique d'un partenaire avec des filtres sur :
|
||||
- objet metier
|
||||
- nom du champs
|
||||
"""
|
||||
@app.route('/myclass/api/get_list_specific_field_partner_with_filter/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def get_list_specific_field_partner_with_filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### get_list_specific_field_partner_with_filter : payload = ",payload)
|
||||
status, retval = base_specific_fields.get_list_specific_field_partner_with_filter(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API de Recuperation de liste de champs spécifique d'un objet pou un partenaire
|
||||
"""
|
||||
|
@ -5251,6 +5287,18 @@ def get_list_specific_field_partner_by_object():
|
|||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
"""
|
||||
Cette API retourne la liste des objet metier eligibles
|
||||
pour l'ajout de champs spécifiques
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Collection_Eligible_Champ_Specific/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Collection_Eligible_Champ_Specific():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Collection_Eligible_Champ_Specific : payload = ",payload)
|
||||
status, retval = base_specific_fields.Get_Collection_Eligible_Champ_Specific()
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -399,6 +399,25 @@ def Add_Ressource_Humaine(diction):
|
|||
"- Le type de profil "+str(profil)+" n'est pas autorisé")
|
||||
return False, "- Le type de profil "+str(profil)+" n'est pas autorisé"
|
||||
|
||||
"""
|
||||
Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire
|
||||
"""
|
||||
|
||||
# Recuperation des champs spécifiques se trouvant dans le dictionnaire. ils commencent tous par 'my_'
|
||||
for val in diction.keys():
|
||||
if (val.startswith('my_')):
|
||||
if (MYSY_GV.dbname['base_specific_fields'].count_documents(
|
||||
{'partner_owner_recid': str(my_partner['recid']),
|
||||
'related_collection': 'ressource_humaine',
|
||||
'field_name': str(val),
|
||||
'valide': '1',
|
||||
'locked': '0'}) != 1):
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé ")
|
||||
return False, " Les informations fournies sont incorrectes"
|
||||
|
||||
data[str(val)] = diction[str(val)]
|
||||
|
||||
|
||||
data['valide'] = '1'
|
||||
data['locked'] = '0'
|
||||
|
@ -976,7 +995,6 @@ def Get_List_Profil_Ressource_Humaine(diction):
|
|||
|
||||
"""
|
||||
Recuperation de la liste des ressources humaines avec des filtres sur
|
||||
Recuperation de la liste des ressources humaines avec des filtres sur
|
||||
- nom
|
||||
- email
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue