Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
nymphalis_project
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Le Filament
Nymphalis
nymphalis_project
Validations
3295aba8
Valider
3295aba8
rédigé
Il y a 6 ans
par
Juliana
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Modifs CRON
parent
078357fd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
models/project.py
+7
-28
7 ajouts, 28 suppressions
models/project.py
avec
7 ajouts
et
28 suppressions
models/project.py
+
7
−
28
Voir le fichier @
3295aba8
...
@@ -27,31 +27,20 @@ class NymphProject(models.Model):
...
@@ -27,31 +27,20 @@ class NymphProject(models.Model):
def
_cron_project_zone
(
self
):
def
_cron_project_zone
(
self
):
projects
=
self
.
env
[
'
project.project
'
].
search
([
projects
=
self
.
env
[
'
project.project
'
].
search
([
(
'
zone_etude
'
,
'
=
'
,
False
)])
(
'
zone_etude
'
,
'
=
'
,
False
)])
print
(
"
projets
"
,
str
(
projects
))
for
p
in
projects
:
for
p
in
projects
:
body
=
'
<li>Projet :
'
+
p
.
name
+
'
</li>
'
body
=
'
<li>Projet :
'
+
p
.
name
+
'
</li>
'
body_html
=
"
<div><b>%(title)s</b> : %(body)s</div>
"
%
{
body_html
=
"
<div><b>%(title)s</b> : %(body)s</div>
"
%
{
'
title
'
:
"
Zone étude à remplir
"
,
'
title
'
:
"
Zone étude à remplir
"
,
'
body
'
:
body
,
'
body
'
:
body
,
'
partner_ids
'
:
[(
p
.
user_id
.
partner_id
.
id
)],
}
}
# message = self.env['mail.message'].create(
# {
# 'message_type': "notification",
# "subtype": 1, # subject type
# 'body': body,
# 'subject': "Message subject",
# 'needaction_partner_ids': [(p.user_id.partner_id.id)],
# # partner to whom you send notification
# })
p
.
message_post
(
p
.
message_post
(
body
=
body_html
,
body
=
body_html
,
subject
=
'
Zone étude
'
,
subject
=
'
Zone étude
'
,
message_type
=
'
notification
'
,
message_type
=
'
notification
'
,
partner_ids
=
[(
p
.
user_id
.
partner_id
.
id
)],
subtype
=
'
mail.mt_comment
'
,
subtype_id
=
1
,
partner_ids
=
[(
6
,
0
,
([
p
.
user_id
.
partner_id
.
id
]))],
model
=
'
project.project
'
,
res_id
=
p
.
id
)
)
...
@@ -109,30 +98,20 @@ class NymphProjectTask(models.Model):
...
@@ -109,30 +98,20 @@ class NymphProjectTask(models.Model):
tasks
=
self
.
env
[
'
project.task
'
].
search
([
tasks
=
self
.
env
[
'
project.task
'
].
search
([
(
'
date_deadline
'
,
'
<
'
,
datetime
.
now
().
date
()
+
timedelta
(
days
=
15
))])
(
'
date_deadline
'
,
'
<
'
,
datetime
.
now
().
date
()
+
timedelta
(
days
=
15
))])
for
p
in
tasks
:
for
p
in
tasks
:
print
(
"
task
"
,
str
(
p
.
name
))
print
(
"
date
"
,
str
(
p
.
date_deadline
))
# responsable = p.user_id.partner_id.id
body
=
'
<li>Tâche:
'
+
p
.
name
+
'
</li>
'
body
=
'
<li>Tâche:
'
+
p
.
name
+
'
</li>
'
body
+=
'
<li>Deadline:
'
+
str
(
p
.
date_deadline
)
+
'
</li>
'
body
+=
'
<li>Deadline:
'
+
str
(
p
.
date_deadline
)
+
'
</li>
'
body_html
=
"
<div><b>%(title)s</b> : %(body)s</div>
"
%
{
body_html
=
"
<div><b>%(title)s</b> : %(body)s</div>
"
%
{
'
title
'
:
"
Tâche à effectuer avant la deadline
"
,
'
title
'
:
"
Tâche à effectuer avant la deadline
"
,
'
body
'
:
body
,
'
body
'
:
body
,
'
partner_ids
'
:
[(
p
.
user_id
.
partner_id
.
id
)],
}
}
# message = self.env['mail.message'].create({
# 'message_type': "notification",
# "subtype": 1, # subject type
# 'body': body,
# 'subject': "Message subject",
# 'needaction_partner_ids': [(p.user_id.partner_id.id)],
# })
p
.
message_post
(
p
.
message_post
(
body
=
body_html
,
body
=
body_html
,
subject
=
'
Tâches restantes à effectuer
'
,
subject
=
'
Tâches restantes à effectuer
'
,
message_type
=
'
notification
'
,
message_type
=
'
notification
'
,
partner_ids
=
[(
p
.
user_id
.
partner_id
.
id
)],
subtype
=
'
mail.mt_comment
'
,
subtype_id
=
1
,
partner_ids
=
[(
6
,
0
,
([
p
.
user_id
.
partner_id
.
id
]))],
model
=
'
project.task
'
,
res_id
=
p
.
id
)
)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter