Browse Source

[WIP][ADD][8.0]mail_message_auto_expand module

pull/167/head
kiplangatdan 7 years ago
parent
commit
c09249d62c
  1. 3
      mail_message_auto_expand/__init__.py
  2. 13
      mail_message_auto_expand/__openerp__.py
  3. 28
      mail_message_auto_expand/mail.py
  4. BIN
      mail_message_auto_expand/static/description/icon.png

3
mail_message_auto_expand/__init__.py

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
import mail

13
mail_message_auto_expand/__openerp__.py

@ -0,0 +1,13 @@
{
'name': 'Mail Message Auto Expand',
'version': '8.0',
'summary': 'Expands the Read More Automatically',
'description': '',
'author': 'Sunflower IT',
'website': 'http://www.sunflowerweb.nl',
'category': 'Social Network',
'images': [],
'depends': ['mail'],
'data': [],
'installable': True,
}

28
mail_message_auto_expand/mail.py

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# © 2017 Sunflower IT (http://sunflowerweb.nl)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from openerp import _, api, models, tools
from openerp.tools import html_email_clean
from openerp.tools.translate import _
from HTMLParser import HTMLParser
from openerp import SUPERUSER_ID, api
_logger = logging.getLogger(__name__)
class MailMessage(models.Model):
_inherit = 'mail.message'
def _message_read_dict(self, cr, uid, message, parent_id=False,
context=None):
max_length = 10000 # Increase the max lenght
body_short = html_email_clean(message.body, remove=False, shorten=False,
max_length=max_length) # Disable shortening
ret = super(MailMessage, self)._message_read_dict(cr, uid,
message,
parent_id=parent_id,
context=context)
ret['body_short'] = body_short
return ret

BIN
mail_message_auto_expand/static/description/icon.png

After

Width: 300  |  Height: 300  |  Size: 26 KiB

Loading…
Cancel
Save