diff --git a/attachment_synchronize/models/attachment.py b/attachment_synchronize/models/attachment.py
index 231cd5181..926b5a6e6 100644
--- a/attachment_synchronize/models/attachment.py
+++ b/attachment_synchronize/models/attachment.py
@@ -18,9 +18,14 @@ class IrAttachmentMetadata(models.Model):
'Export File (External location)')
])
- @api.multi
def _run(self):
- super(IrAttachmentMetadata, self)._run()
+ super()._run()
if self.file_type == 'export':
path = os.path.join(self.task_id.filepath, self.datas_fname)
self.storage_backend_id._add_b64_data(path, self.datas)
+
+ def _get_failure_emails(self):
+ res = super()._get_failure_emails()
+ if self.task_id.emails:
+ res = self.task_id.emails
+ return res
diff --git a/attachment_synchronize/models/task.py b/attachment_synchronize/models/task.py
index 10ac78d55..4641a1b1d 100644
--- a/attachment_synchronize/models/task.py
+++ b/attachment_synchronize/models/task.py
@@ -81,6 +81,10 @@ class StorageTask(models.Model):
check_duplicated_files = fields.Boolean(
string='Check duplicated files',
help='If checked, will avoid duplication file import')
+ emails = fields.Char(
+ string="Emails",
+ help="list of email which should be notified in case of failure "
+ "when excuting the files linked to this task")
@api.multi
def _prepare_attachment_vals(self, datas, filename):
diff --git a/attachment_synchronize/views/task_view.xml b/attachment_synchronize/views/task_view.xml
index 198dacb83..9195143aa 100644
--- a/attachment_synchronize/views/task_view.xml
+++ b/attachment_synchronize/views/task_view.xml
@@ -21,6 +21,7 @@
+