Skip to content
Extraits de code Groupes Projets
Valider ac49ab42 rédigé par Benjamin's avatar Benjamin
Parcourir les fichiers

[modif] body html

parent 93d21aa6
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -38,11 +38,16 @@ class LeFilamentMaintenance(models.Model):
def action_ok(self):
if self.lf_m_cycle != 0 and self.lf_m_date_task:
next_date = datetime.strptime(self.lf_m_date_task, '%Y-%m-%d %H:%M:%S') + timedelta(days=self.lf_m_cycle)
body_html = "<div><b>%(title)s</b> : %(action)s</div></ul><li>Prochaine action le %(next)s</li><li>Commentaire : %(comment)s</li></ul>" % {
body = '<li>Prochaine action le '+next_date.strftime('%d/%m/%Y')+'</li>'
if self.lf_m_task:
body += '<li>Action : '+self.lf_m_task+'</li>'
if self.lf_m_comment:
body += '<li>Commentaire : '+self.lf_m_comment+'</li>'
body_html = "<div><b>%(title)s</b> : %(action)s</div></ul>%(body)s</ul>" % {
'title': self.name,
'action': 'Action OK',
'body': body,
'comment': self.lf_m_comment or '',
'next' : next_date.strftime('%d/%m/%Y'),
}
self.message_post(body_html, subject='Activité OK', subtype_id=self.env.ref("lefilament_maintenance.mail_message_subtype_maintenance").id )
self.lf_m_date_task = next_date
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter