summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models
diff options
context:
space:
mode:
authorNasreddin (bon) <bon@odoo.com>2020-11-02 09:45:16 +0000
committerNasreddin (bon) <bon@odoo.com>2020-11-02 09:45:16 +0000
commit64a1a7b78782cb255a47d2e7d55d605c8175b6ce (patch)
tree56cfd072b91d7615e1b0447cb7500c655983bc8d /addons/mail/static/src/models
parentf4a23c1476f4923a83ff113f571042a9eda6c92b (diff)
[FIX] mail: mail not sent because partner not find in chatter
Issue Partner not found if multiple breakline in message. Cause '\n' not replaced by '\n ' globaly. '<br/>' not replaced by '<br/> ' globaly. Fix of this commit : https://github.com/odoo/odoo/commit/902302598e98efab52d61979e85def6d025ff2ab opw-2322577 closes odoo/odoo#61119 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models')
-rw-r--r--addons/mail/static/src/models/composer/composer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/static/src/models/composer/composer.js b/addons/mail/static/src/models/composer/composer.js
index efd7a3744a9..a18c78d3a2e 100644
--- a/addons/mail/static/src/models/composer/composer.js
+++ b/addons/mail/static/src/models/composer/composer.js
@@ -501,7 +501,7 @@ function factory(dependencies) {
* @returns {mail.partner[]}
*/
_computeMentionedPartners() {
- const inputMentions = this.textInputContent.replace('\n', "\n ").match(
+ const inputMentions = this.textInputContent.replace(/\n/g, "\n ").match(
new RegExp("@[^ ]+(?= |&nbsp;|$)", 'g')
) || [];
const unmentionedPartners = [];
@@ -571,7 +571,7 @@ function factory(dependencies) {
if (this.mentionedPartners.length === 0 && this.mentionedChannels.length === 0) {
return body;
}
- const inputMentions = body.replace("<br/>", "<br/> ")
+ const inputMentions = body.replace(new RegExp('<br/>', 'g'), "<br/> ")
.match(new RegExp("(@|#)" + '[^ ]+(?= |&nbsp;|$)', 'g'))
.filter(match => !match.endsWith("<br/>"));
const substrings = [];