From decdc344a7e964658c9bf99794c700a40235adb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Fern=C3=A1ndez=20=40PlanetaTIC?= Date: Tue, 2 Apr 2019 10:51:16 +0200 Subject: [PATCH] [FIX] auto_backup: notification not sent, fix message subtype --- auto_backup/models/db_backup.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/auto_backup/models/db_backup.py b/auto_backup/models/db_backup.py index 7b1ef6e80..20f44216c 100644 --- a/auto_backup/models/db_backup.py +++ b/auto_backup/models/db_backup.py @@ -207,13 +207,17 @@ class DbBackup(models.Model): "

%s

%s
" % ( _("Database backup failed."), escaped_tb), - subtype=self.env.ref( + subtype_id=self.env.ref( "auto_backup.mail_message_subtype_failure" - ), + ).id, ) else: _logger.info("Database backup succeeded: %s", self.name) - self.message_post(_("Database backup succeeded.")) + self.message_post( + _("Database backup succeeded."), + subtype_id=self.env.ref( + "auto_backup.mail_message_subtype_success" + ).id) @api.multi def cleanup(self): @@ -252,7 +256,9 @@ class DbBackup(models.Model): "

%s

%s
" % ( _("Cleanup of old database backups failed."), escaped_tb), - subtype=self.env.ref("auto_backup.failure")) + subtype_id=self.env.ref( + "auto_backup.mail_message_subtype_failure" + ).id) else: _logger.info("Cleanup of old database backups succeeded: %s", self.name)