kiplangatdan
7 years ago
6 changed files with 89 additions and 42 deletions
-
55mail_message_auto_expand/README.rst
-
6mail_message_auto_expand/__init__.py
-
33mail_message_auto_expand/__openerp__.py
-
28mail_message_auto_expand/mail.py
-
BINmail_message_auto_expand/static/description/icon.png
-
9mail_message_auto_expand/static/src/xml/mail_autoexpand.xml
@ -0,0 +1,55 @@ |
|||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
======================== |
|||
Mail Message Auto Expand |
|||
======================== |
|||
|
|||
This module extends the functionality of mail. It automatically expands the |
|||
messages in the chatter. Instead of having to click *read more* |
|||
|
|||
Usage |
|||
===== |
|||
|
|||
Just install |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/ social/issues>`_. |
|||
In case of trouble, please check there if your issue has already been reported. |
|||
If you spotted it first, help us smash it by providing a detailed and |
|||
welcomed feedback `here <https://github.com/OCA/ |
|||
social/issues/new?body=module:%20 mail_message_auto_expand%0Aversion:%20 |
|||
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. |
|||
|
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Images |
|||
------ |
|||
|
|||
* PICOL Icon Generator `here <http://picol.org/picol_icon_generator>`_. |
|||
|
|||
Contributors |
|||
------------ |
|||
|
|||
* Dan Kiplangat <dan@sunflowerweb.nl> |
|||
* Tom Blauwendraat <tom@sunflowerweb.nl> |
|||
|
|||
Maintainer |
|||
---------- |
|||
|
|||
.. image:: https://odoo-community.org/logo.png |
|||
:alt: Odoo Community Association |
|||
:target: https://odoo-community.org |
|||
|
|||
This module is maintained by the OCA. |
|||
|
|||
OCA, or the Odoo Community Association, is a nonprofit organization whose |
|||
mission is to support the collaborative development of Odoo features and |
|||
promote its widespread use. |
|||
|
|||
To contribute to this module, please visit http://odoo-community.org. |
@ -1,3 +1,5 @@ |
|||
# -*- encoding: utf-8 -*- |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Sunflower IT (http://sunflowerweb.nl) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
import mail |
|||
from . import models |
@ -1,13 +1,22 @@ |
|||
{ |
|||
'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, |
|||
# -*- coding: utf-8 -*- |
|||
# © 2016 Sunflower IT (http://sunflowerweb.nl) |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
{ |
|||
"name": "Mail Message Auto Expand", |
|||
"summary": "Expands the Read More Automatically", |
|||
"version": "8.0.1.0.0", |
|||
"category": "Social Network", |
|||
"website": "https://sunflowerweb.nl", |
|||
"author": "Sunflower IT, Odoo Community Association (OCA)", |
|||
"license": "AGPL-3", |
|||
"application": False, |
|||
"installable": True, |
|||
"depends": [ |
|||
"mail", |
|||
], |
|||
"data": [], |
|||
"qweb": [ |
|||
"static/src/xml/mail_autoexpand.xml", |
|||
], |
|||
} |
@ -1,28 +0,0 @@ |
|||
# -*- 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 |
|||
|
|||
|
Before Width: 300 | Height: 300 | Size: 26 KiB After Width: 128 | Height: 128 | Size: 2.2 KiB |
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
|
|||
<template> |
|||
<t t-extend="mail.thread.message"> |
|||
<t t-jquery="div[class=oe_msg_center] div[class=oe_msg_body_short]" t-operation="replace"> |
|||
<t t-raw="widget.body"/> |
|||
</t> |
|||
</t> |
|||
</template> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue