summaryrefslogtreecommitdiff
path: root/addons/website_mail
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-10-14 09:16:46 +0000
committerThibault Delavallée <tde@odoo.com>2019-12-02 15:18:44 +0000
commit46b9a97b56d74503d6e86b16466982c750a66422 (patch)
treee7964d2ad7906b14e8322d4898e5c373355ef9b2 /addons/website_mail
parente2b33f460d0f2359e65107f8615c7e827350b4e7 (diff)
[MOV] {website_}mail: move description field of mail.message directly in mail
PURPOSE Clean posting process and improve mail.message definition and comprehension. SPECIFCIATIONS Move description from website_mail directly to mail. Anyway it is a non stored computed field and therefore having it available directly in mail does not cost anything. LINKS Task ID 2071556 PR #38692
Diffstat (limited to 'addons/website_mail')
-rw-r--r--addons/website_mail/models/mail_message.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/addons/website_mail/models/mail_message.py b/addons/website_mail/models/mail_message.py
index 8070c7d7fcc..2de32b9f4f0 100644
--- a/addons/website_mail/models/mail_message.py
+++ b/addons/website_mail/models/mail_message.py
@@ -3,7 +3,6 @@
from odoo import api, fields, models, _
from odoo.osv import expression
-from odoo.tools import html2plaintext
from odoo.exceptions import AccessError
@@ -23,7 +22,6 @@ class MailMessage(models.Model):
return defaults
- description = fields.Char(compute="_compute_description", help='Message description: either the subject, or the beginning of the body')
website_published = fields.Boolean(string='Published', help="Visible on the website as a comment", copy=False)
@api.model
@@ -31,14 +29,6 @@ class MailMessage(models.Model):
domain = super(MailMessage, self)._non_employee_message_domain()
return expression.AND([domain, [('website_published', '=', True)]])
- def _compute_description(self):
- for message in self:
- if message.subject:
- message.description = message.subject
- else:
- plaintext_ct = '' if not message.body else html2plaintext(message.body)
- message.description = plaintext_ct[:30] + '%s' % (' [...]' if len(plaintext_ct) >= 30 else '')
-
@api.model
def _search(self, args, offset=0, limit=None, order=None, count=False, access_rights_uid=None):
""" Override that adds specific access rights of mail.message, to restrict