[IMP] mail_tracking: Discuss failed messages: Only show confirmation if needed
This commit is contained in:
parent
6b55471fc3
commit
ced062db12
@ -341,18 +341,21 @@ odoo.define("mail_tracking.FailedMessageDiscuss", function(require) {
|
|||||||
_onSetAllAsReviewedClicked: function() {
|
_onSetAllAsReviewedClicked: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
var failed = this.call("mail_service", "getMailbox", "failed");
|
var failed = this.call("mail_service", "getMailbox", "failed");
|
||||||
var promptText = _.str.sprintf(
|
var failed_counter = failed.getMailboxCounter();
|
||||||
_t(
|
if (failed_counter > 0) {
|
||||||
"Do you really want to mark as reviewed all the" +
|
var promptText = _.str.sprintf(
|
||||||
" failed messages (%d)?"
|
_t(
|
||||||
),
|
"Do you really want to mark as reviewed all the" +
|
||||||
failed.getMailboxCounter()
|
" failed messages (%d)?"
|
||||||
);
|
),
|
||||||
Dialog.confirm(this, promptText, {
|
failed_counter
|
||||||
confirm_callback: function() {
|
);
|
||||||
self._thread.setAllMessagesAsReviewed();
|
Dialog.confirm(this, promptText, {
|
||||||
},
|
confirm_callback: function() {
|
||||||
});
|
self._thread.setAllMessagesAsReviewed();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user