summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/models/mail_failure.js
diff options
context:
space:
mode:
authorAntoine Prieels (ANP) <anp@odoo.com>2019-01-02 09:45:56 +0000
committerAntoine Prieels (ANP) <anp@odoo.com>2019-01-02 10:14:58 +0000
commit3e9102bb50c50fa8d8dea341a7690130045a3d42 (patch)
tree774435eec3538da274084db000f1151b37d8fd64 /addons/mail/static/src/js/models/mail_failure.js
parentd029ee1bcb33197c48ce6e0a25c86c8f127074dc (diff)
[IMP] mail: group mailFailures by type in systray
We want to add new kinds of failures to the list in the systray, such as Snailmail or SMS failures. Until now, failures linked to documents of the same model were grouped together in the systray. Different types of failures should not be grouped in a single line so we add a '_failureType' variable to mailFailures and group them only if their type is the same. closes odoo/odoo#29855
Diffstat (limited to 'addons/mail/static/src/js/models/mail_failure.js')
-rw-r--r--addons/mail/static/src/js/models/mail_failure.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/models/mail_failure.js b/addons/mail/static/src/js/models/mail_failure.js
index 390b195f8d9..9a007954a5a 100644
--- a/addons/mail/static/src/js/models/mail_failure.js
+++ b/addons/mail/static/src/js/models/mail_failure.js
@@ -13,6 +13,7 @@ var MailFailure = Class.extend(Mixins.EventDispatcherMixin, ServicesMixin, {
/**
* @param {mail.Manager} parent
* @param {Object} data
+ * @param {string} data.failure_type
* @param {string} data.last_message_date
* @param {integer} data.message_id
* @param {string} data.model
@@ -29,6 +30,7 @@ var MailFailure = Class.extend(Mixins.EventDispatcherMixin, ServicesMixin, {
this._documentID = data.res_id;
this._documentModel = data.model;
+ this._failureType = data.failure_type || 'mail';
this._lastMessageDate = moment(); // by default: current datetime
this._messageID = data.message_id;
this._modelName = data.model_name;
@@ -63,6 +65,14 @@ var MailFailure = Class.extend(Mixins.EventDispatcherMixin, ServicesMixin, {
return this._documentID;
},
/**
+ * Get the type of failure of this mail failure.
+ *
+ * @returns {string}
+ */
+ getFailureType: function () {
+ return this._failureType;
+ },
+ /**
* Get the ID of the message that this mail failure is related to.
*
* @returns {integer}