14/12/2023 - 22h
parent
2f1e327950
commit
ba57632866
|
@ -1,11 +1,9 @@
|
||||||
<?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="14/12/2023 - 16h16">
|
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="14/12/2023 - 21h">
|
||||||
<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$/Contact.py" beforeDir="false" afterPath="$PROJECT_DIR$/Contact.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/partner_document_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_document_mgt.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$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.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" />
|
||||||
|
@ -75,13 +73,6 @@
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
<updated>1680804787304</updated>
|
<updated>1680804787304</updated>
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00123" summary="03/10/2023 - 21h40">
|
|
||||||
<created>1696362068718</created>
|
|
||||||
<option name="number" value="00123" />
|
|
||||||
<option name="presentableId" value="LOCAL-00123" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1696362068719</updated>
|
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00124" summary="04/10/2023 - 21h40">
|
<task id="LOCAL-00124" summary="04/10/2023 - 21h40">
|
||||||
<created>1696447101805</created>
|
<created>1696447101805</created>
|
||||||
<option name="number" value="00124" />
|
<option name="number" value="00124" />
|
||||||
|
@ -418,7 +409,14 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1702566989857</updated>
|
<updated>1702566989857</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="172" />
|
<task id="LOCAL-00172" summary="14/12/2023 - 21h">
|
||||||
|
<created>1702583972424</created>
|
||||||
|
<option name="number" value="00172" />
|
||||||
|
<option name="presentableId" value="LOCAL-00172" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1702583972425</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="173" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
@ -433,7 +431,6 @@
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="14/11/2023 - 12h" />
|
|
||||||
<MESSAGE value="14/11/2023 - 20h" />
|
<MESSAGE value="14/11/2023 - 20h" />
|
||||||
<MESSAGE value="15/11/2023 - 12h" />
|
<MESSAGE value="15/11/2023 - 12h" />
|
||||||
<MESSAGE value="15/11/2023 - 17h" />
|
<MESSAGE value="15/11/2023 - 17h" />
|
||||||
|
@ -458,6 +455,7 @@
|
||||||
<MESSAGE value="13/12/2023 - 23h30" />
|
<MESSAGE value="13/12/2023 - 23h30" />
|
||||||
<MESSAGE value="14/12/2023 - 08h30" />
|
<MESSAGE value="14/12/2023 - 08h30" />
|
||||||
<MESSAGE value="14/12/2023 - 16h16" />
|
<MESSAGE value="14/12/2023 - 16h16" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="14/12/2023 - 16h16" />
|
<MESSAGE value="14/12/2023 - 21h" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="14/12/2023 - 21h" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -38,7 +38,8 @@ def Add_Partner_Document(diction):
|
||||||
"""
|
"""
|
||||||
Verification des input acceptés
|
Verification des input acceptés
|
||||||
"""
|
"""
|
||||||
field_list = ['token', "nom", "ref_interne", "type_doc", "cible", "sujet",'contenu_doc', 'duplicate']
|
field_list = ['token', "nom", "ref_interne", "type_doc", "cible", "sujet",'contenu_doc', 'duplicate',
|
||||||
|
'joint_pdf', 'default_version', 'corps_mail']
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -84,7 +85,7 @@ def Add_Partner_Document(diction):
|
||||||
3]) + " - Le champ 'ref_interne' fait plus de 255 caractères ")
|
3]) + " - Le champ 'ref_interne' fait plus de 255 caractères ")
|
||||||
|
|
||||||
return False, " - Le champ 'ref_interne' fait plus de 255 caractères "
|
return False, " - Le champ 'ref_interne' fait plus de 255 caractères "
|
||||||
data['ref_interne'] = diction['ref_interne']
|
data['ref_interne'] = ref_interne
|
||||||
|
|
||||||
nom = ""
|
nom = ""
|
||||||
if ("nom" in diction.keys()):
|
if ("nom" in diction.keys()):
|
||||||
|
@ -96,7 +97,7 @@ def Add_Partner_Document(diction):
|
||||||
3]) + " - Le champ 'nom' fait plus de 255 caractères ")
|
3]) + " - Le champ 'nom' fait plus de 255 caractères ")
|
||||||
|
|
||||||
return False, " - Le champ 'nom' fait plus de 255 caractères "
|
return False, " - Le champ 'nom' fait plus de 255 caractères "
|
||||||
data['nom'] = diction['nom']
|
data['nom'] = nom
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -110,7 +111,7 @@ def Add_Partner_Document(diction):
|
||||||
3]) + " - Le champ 'sujet' fait plus de 255 caractères ")
|
3]) + " - Le champ 'sujet' fait plus de 255 caractères ")
|
||||||
|
|
||||||
return False, " - Le champ 'sujet' fait plus de 255 caractères "
|
return False, " - Le champ 'sujet' fait plus de 255 caractères "
|
||||||
data['sujet'] = diction['sujet']
|
data['sujet'] = sujet
|
||||||
|
|
||||||
|
|
||||||
cible = ""
|
cible = ""
|
||||||
|
@ -123,7 +124,7 @@ def Add_Partner_Document(diction):
|
||||||
3]) + " - Le champ 'cible' fait plus de 255 caractères ")
|
3]) + " - Le champ 'cible' fait plus de 255 caractères ")
|
||||||
|
|
||||||
return False, " - Le champ 'cible' fait plus de 255 caractères "
|
return False, " - Le champ 'cible' fait plus de 255 caractères "
|
||||||
data['cible'] = diction['cible']
|
data['cible'] = cible
|
||||||
|
|
||||||
|
|
||||||
type_doc = ""
|
type_doc = ""
|
||||||
|
@ -136,20 +137,21 @@ def Add_Partner_Document(diction):
|
||||||
3]) + " - Le champ 'type_doc' n'est pas accepté. les valeurs acceptées sont "+str(MYSY_GV.MODELE_DOCUMENT_TYPE))
|
3]) + " - Le champ 'type_doc' n'est pas accepté. les valeurs acceptées sont "+str(MYSY_GV.MODELE_DOCUMENT_TYPE))
|
||||||
|
|
||||||
return False, " - Le champ 'type_doc' n'est pas accepté. les valeurs acceptées sont "+str(MYSY_GV.MODELE_DOCUMENT_TYPE)
|
return False, " - Le champ 'type_doc' n'est pas accepté. les valeurs acceptées sont "+str(MYSY_GV.MODELE_DOCUMENT_TYPE)
|
||||||
data['type_doc'] = diction['type_doc']
|
data['type_doc'] = type_doc
|
||||||
|
|
||||||
|
|
||||||
contenu_doc = ""
|
contenu_doc = ""
|
||||||
if ("contenu_doc" in diction.keys()):
|
if ("contenu_doc" in diction.keys()):
|
||||||
if diction['contenu_doc']:
|
if diction['contenu_doc']:
|
||||||
contenu_doc = diction['contenu_doc']
|
contenu_doc = diction['contenu_doc']
|
||||||
if (len(str(sujet)) > 10000):
|
if (len(str(contenu_doc)) > 10000):
|
||||||
mycommon.myprint(
|
mycommon.myprint(
|
||||||
str(inspect.stack()[0][
|
str(inspect.stack()[0][
|
||||||
3]) + " - Le champ 'contenu_doc' fait plus de 10000 caractère ")
|
3]) + " - Le champ 'contenu_doc' fait plus de 10000 caractères ")
|
||||||
|
|
||||||
|
return False, " - Le champ 'contenu_doc' fait plus de 10000 caractères "
|
||||||
|
data['contenu_doc'] = contenu_doc
|
||||||
|
|
||||||
return False, " - Le champ 'sujet' fait plus de 10000 caractère "
|
|
||||||
data['contenu_doc'] = diction['contenu_doc']
|
|
||||||
|
|
||||||
duplicate = "0"
|
duplicate = "0"
|
||||||
if ("duplicate" in diction.keys()):
|
if ("duplicate" in diction.keys()):
|
||||||
|
@ -161,6 +163,39 @@ def Add_Partner_Document(diction):
|
||||||
data['duplicate'] = duplicate
|
data['duplicate'] = duplicate
|
||||||
|
|
||||||
|
|
||||||
|
# ----
|
||||||
|
joint_pdf = "0"
|
||||||
|
if ("joint_pdf" in diction.keys()):
|
||||||
|
if diction['joint_pdf']:
|
||||||
|
joint_pdf = diction['joint_pdf']
|
||||||
|
if (str(joint_pdf) not in ['0', '1']):
|
||||||
|
joint_pdf = '0'
|
||||||
|
|
||||||
|
data['joint_pdf'] = joint_pdf
|
||||||
|
|
||||||
|
default_version = "0"
|
||||||
|
if ("default_version" in diction.keys()):
|
||||||
|
if diction['default_version']:
|
||||||
|
default_version = diction['default_version']
|
||||||
|
if (str(default_version) not in ['0', '1']):
|
||||||
|
default_version = '0'
|
||||||
|
|
||||||
|
data['default_version'] = default_version
|
||||||
|
|
||||||
|
corps_mail = ""
|
||||||
|
if ("corps_mail" in diction.keys()):
|
||||||
|
if diction['corps_mail']:
|
||||||
|
corps_mail = diction['corps_mail']
|
||||||
|
if (len(str(corps_mail)) > 10000):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][
|
||||||
|
3]) + " - Le champ 'corps_mail' fait plus de 10000 caractères ")
|
||||||
|
|
||||||
|
return False, " - Le champ 'corps_mail' fait plus de 10000 caractères "
|
||||||
|
data['corps_mail'] = corps_mail
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
|
|
||||||
# Verifier qu'il n'existe pas un document avec le meme code code interne
|
# Verifier qu'il n'existe pas un document avec le meme code code interne
|
||||||
exist_doc_count = MYSY_GV.dbname['courrier_template'].count_documents({'ref_interne':str(ref_interne), 'valide':'1',
|
exist_doc_count = MYSY_GV.dbname['courrier_template'].count_documents({'ref_interne':str(ref_interne), 'valide':'1',
|
||||||
|
@ -172,6 +207,20 @@ def Add_Partner_Document(diction):
|
||||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Il existe déjà un document avec la meme reference interne ")
|
mycommon.myprint(str(inspect.stack()[0][3]) + " - Il existe déjà un document avec la meme reference interne ")
|
||||||
return False, "- Il existe déjà un document avec la meme reference interne "
|
return False, "- Il existe déjà un document avec la meme reference interne "
|
||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
Si le document est une vesion par defaut, il faut alors decoché un eventuel document avec le meme :
|
||||||
|
- ref_interne
|
||||||
|
- type_doc
|
||||||
|
|
||||||
|
"""
|
||||||
|
if( str(diction['default_version']) == "1"):
|
||||||
|
MYSY_GV.dbname['courrier_template'].update_many({'ref_interne':str(ref_interne),
|
||||||
|
'valide':'1',
|
||||||
|
'partner_owner_recid':str(my_partner['recid']),
|
||||||
|
'type_doc':str(diction['type_doc'])},
|
||||||
|
{'$set':{'default_version':'0'}})
|
||||||
|
|
||||||
data['valide'] = '1'
|
data['valide'] = '1'
|
||||||
data['locked'] = '0'
|
data['locked'] = '0'
|
||||||
data['date_update'] = str(datetime.now())
|
data['date_update'] = str(datetime.now())
|
||||||
|
@ -202,9 +251,8 @@ def Update_Partner_Document(diction):
|
||||||
"""
|
"""
|
||||||
Verification des input acceptés
|
Verification des input acceptés
|
||||||
"""
|
"""
|
||||||
field_list = ['token', "nom", "ref_interne", "type_doc", "cible", "sujet",'contenu_doc', '_id']
|
field_list = ['token', "nom", "ref_interne", "type_doc", "cible", "sujet",'contenu_doc', '_id',
|
||||||
|
'joint_pdf', 'default_version', 'corps_mail']
|
||||||
|
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -332,16 +380,67 @@ def Update_Partner_Document(diction):
|
||||||
if (len(str(sujet)) > 10000):
|
if (len(str(sujet)) > 10000):
|
||||||
mycommon.myprint(
|
mycommon.myprint(
|
||||||
str(inspect.stack()[0][
|
str(inspect.stack()[0][
|
||||||
3]) + " - Le champ 'contenu_doc' fait plus de 10000 caractère ")
|
3]) + " - Le champ 'contenu_doc' fait plus de 10000 caractères ")
|
||||||
|
|
||||||
return False, " - Le champ 'sujet' fait plus de 10000 caractère "
|
return False, " - Le champ 'contenu_doc' fait plus de 10000 caractère "
|
||||||
data_update['contenu_doc'] = diction['contenu_doc']
|
data_update['contenu_doc'] = diction['contenu_doc']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ----
|
||||||
|
joint_pdf = "0"
|
||||||
|
if ("joint_pdf" in diction.keys()):
|
||||||
|
if diction['joint_pdf']:
|
||||||
|
joint_pdf = diction['joint_pdf']
|
||||||
|
if (str(joint_pdf) not in ['0', '1']):
|
||||||
|
joint_pdf = '0'
|
||||||
|
|
||||||
|
data_update['joint_pdf'] = joint_pdf
|
||||||
|
|
||||||
|
default_version = "0"
|
||||||
|
if ("default_version" in diction.keys()):
|
||||||
|
if diction['default_version']:
|
||||||
|
default_version = diction['default_version']
|
||||||
|
if (str(default_version) not in ['0', '1']):
|
||||||
|
default_version = '0'
|
||||||
|
|
||||||
|
data_update['default_version'] = default_version
|
||||||
|
|
||||||
|
corps_mail = ""
|
||||||
|
if ("corps_mail" in diction.keys()):
|
||||||
|
if diction['corps_mail']:
|
||||||
|
corps_mail = diction['corps_mail']
|
||||||
|
if (len(str(corps_mail)) > 10000):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][
|
||||||
|
3]) + " - Le champ 'corps_mail' fait plus de 10000 caractères ")
|
||||||
|
|
||||||
|
return False, " - Le champ 'corps_mail' fait plus de 10000 caractères "
|
||||||
|
data_update['corps_mail'] = corps_mail
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
data_update['valide'] = '1'
|
data_update['valide'] = '1'
|
||||||
data_update['locked'] = '0'
|
data_update['locked'] = '0'
|
||||||
data_update['date_update'] = str(datetime.now())
|
data_update['date_update'] = str(datetime.now())
|
||||||
data_update['update_by'] = str(my_partner['_id'])
|
data_update['update_by'] = str(my_partner['_id'])
|
||||||
|
|
||||||
|
"""
|
||||||
|
Si le document est une vesion par defaut, il faut alors decoché un eventuel document avec le meme :
|
||||||
|
- ref_interne
|
||||||
|
- type_doc
|
||||||
|
|
||||||
|
"""
|
||||||
|
if (str(diction['default_version']) == "1"):
|
||||||
|
MYSY_GV.dbname['courrier_template'].update_many({'ref_interne': str(ref_interne),
|
||||||
|
'valide': '1',
|
||||||
|
'partner_owner_recid': str(my_partner['recid']),
|
||||||
|
'type_doc': str(diction['type_doc'])},
|
||||||
|
{'$set': {'default_version': '0'}})
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Clés de mise à jour
|
Clés de mise à jour
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue