Browse Source

Merge remote-tracking branch 'upstream/9.0' into 10.0-merge-e22dbba

pull/133/head
Ildar Nasyrov 7 years ago
parent
commit
8f7721490b
No known key found for this signature in database GPG Key ID: D1FDACDF9B83578
  1. 4
      mail_base/README.rst
  2. 4
      mail_delete_odoo_footer/README.rst
  3. 0
      mail_delete_odoo_footer/__init__.py
  4. 14
      mail_delete_odoo_footer/__openerp__.py
  5. BIN
      mail_delete_odoo_footer/static/description/icon.png
  6. 6
      mail_fix_empty_body/README.rst
  7. 2
      mail_fix_empty_body/__init__.py
  8. 16
      mail_fix_empty_body/__openerp__.py
  9. 12
      mail_fix_empty_body/models.py
  10. BIN
      mail_fix_empty_body/static/description/icon.png
  11. 65
      mail_fix_empty_body/static/description/index.html
  12. BIN
      mail_fix_empty_body/static/description/receive-false.png
  13. BIN
      mail_fix_empty_body/static/description/receive-ok.png
  14. BIN
      mail_fix_empty_body/static/description/send.png
  15. 2
      mail_fix_header_from/__init__.py
  16. 18
      mail_fix_header_from/__openerp__.py
  17. 5
      mail_fix_header_from/models.py
  18. BIN
      mail_fix_header_from/static/description/icon.png
  19. 2
      mail_outgoing/__init__.py
  20. 22
      mail_outgoing/__openerp__.py
  21. 25
      mail_outgoing/mail_outgoing_models.py
  22. 34
      mail_outgoing/mail_outgoing_views.xml
  23. 3
      mail_outgoing/security/ir.model.access.csv
  24. 33
      mail_outgoing/security/mail_outgoing.xml
  25. BIN
      mail_outgoing/static/description/icon.png
  26. 4
      mail_partner_lang/README.rst
  27. 2
      mail_partner_lang/__init__.py
  28. 14
      mail_partner_lang/__openerp__.py
  29. 88
      mail_partner_lang/models.py
  30. BIN
      mail_partner_lang/static/description/icon.png
  31. 67
      mail_sent/i18n/pt.po
  32. 67
      mail_sent/i18n/pt_BR.po
  33. 2
      mail_todo_custom/README.rst
  34. 0
      mail_todo_custom/__init__.py
  35. 14
      mail_todo_custom/__openerp__.py
  36. 25
      mail_todo_custom/mail_todo_custom.xml
  37. 44
      mail_todo_custom/static/src/js/mail_todo_custom.js
  38. 2
      mass_mailing_extra/__init__.py
  39. 23
      mass_mailing_extra/__openerp__.py
  40. 41
      mass_mailing_extra/models.py
  41. BIN
      mass_mailing_extra/static/description/icon.png
  42. 38
      mass_mailing_extra/views.xml
  43. 1
      res_partner_strip_email/README.rst
  44. 2
      res_partner_strip_email/__init__.py
  45. 22
      res_partner_strip_email/__openerp__.py
  46. 29
      res_partner_strip_email/models.py
  47. BIN
      res_partner_strip_email/static/description/icon.png

4
mail_base/README.rst

@ -17,9 +17,9 @@ Note. Due to odoo restrictions, module makes mail initialization again. That is
Further information Further information
=================== ===================
Demo: http://runbot.it-projects.info/demo/mail-addons/9.0
Demo: http://runbot.it-projects.info/demo/mail-addons/10.0
.. HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_base/
.. HTML Description: https://apps.odoo.com/apps/modules/10.0/mail_base/
Usage instructions: `<doc/index.rst>`_ Usage instructions: `<doc/index.rst>`_

4
mail_delete_odoo_footer/README.rst

@ -1,4 +0,0 @@
Delete Odoo footer in email
===========================
Tested on 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d

0
mail_delete_odoo_footer/__init__.py

14
mail_delete_odoo_footer/__openerp__.py

@ -1,14 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': 'Delete Odoo footer in email (TODO)',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
"category": "Discuss",
"support": "apps@it-projects.info",
'website': 'https://yelizariev.github.io',
'depends': [],
'data': [
],
'installable': False
}

BIN
mail_delete_odoo_footer/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 2.1 KiB

6
mail_fix_empty_body/README.rst

@ -1,6 +0,0 @@
Fix "False" in empty email body
===============================
Description: https://apps.odoo.com/apps/modules/8.0/mail_fix_empty_body/
Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d

2
mail_fix_empty_body/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

16
mail_fix_empty_body/__openerp__.py

@ -1,16 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': 'Fix "False" in empty email body',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
"category": "Discuss",
"support": "apps@it-projects.info",
'website': 'https://twitter.com/yelizariev',
'price': 9.00,
'currency': 'EUR',
'depends': ['mail'],
'data': [
],
'installable': False
}

12
mail_fix_empty_body/models.py

@ -1,12 +0,0 @@
# -*- coding: utf-8 -*-
from openerp import models
class MailComposeMessage(models.TransientModel):
_inherit = 'mail.compose.message'
def get_mail_values(self, cr, uid, wizard, res_ids, context=None):
res = super(MailComposeMessage, self).get_mail_values(cr, uid, wizard, res_ids, context)
for id, d in res.iteritems():
d['body'] = d.get('body') or ''
return res

BIN
mail_fix_empty_body/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 2.1 KiB

65
mail_fix_empty_body/static/description/index.html

@ -1,65 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Fix "False" in empty email body</h2>
<h3 class="oe_slogan">Feel free to send emails without body</h3>
</div>
<div class="oe_span8">
<p class="oe_mt32">
Some time you need to send email with empty body. <br/>E.g. to send some file to partner.
</p>
</div>
<div class="oe_span8 oe_right">
<div class="oe_demo oe_picture oe_screenshot">
<img src="send.png?1"/>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="receive-false.png"/>
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
There is a bug in odoo -- it sends "False" if email body if empty.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<p class="oe_mt32">
This module just fix the issue.
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="receive-ok.png"/>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">
https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
</ul>
</div>
</div>
</section>

BIN
mail_fix_empty_body/static/description/receive-false.png

Before

Width: 366  |  Height: 276  |  Size: 18 KiB

BIN
mail_fix_empty_body/static/description/receive-ok.png

Before

Width: 350  |  Height: 280  |  Size: 16 KiB

BIN
mail_fix_empty_body/static/description/send.png

Before

Width: 581  |  Height: 400  |  Size: 31 KiB

2
mail_fix_header_from/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

18
mail_fix_header_from/__openerp__.py

@ -1,18 +0,0 @@
# -*- coding: utf-8 -*-
{
"name": "Fix non-ascii header 'from' (OBSOLETE)",
"version": "0.3",
"author": "IT-Projects LLC, Ivan Yelizariev",
'license': 'LGPL-3',
"category": "Discuss",
"support": "apps@it-projects.info",
"website": "https://yelizariev.github.io",
"description": """
Obsolete in odoo 8.0 since Sep 10, 2014 https://github.com/odoo/odoo/commit/f2cf6ced17d3477b8858e3a8f955a42cc8a629ff . You can install this module, if you use older version.
""",
"depends": ["base"],
# "init_xml" : [],
# "update_xml" : [],
# "active": True,
'installable': False
}

5
mail_fix_header_from/models.py

@ -1,5 +0,0 @@
# -*- coding: utf-8 -*-
import re
from openerp.addons.base.ir import ir_mail_server
ir_mail_server.name_with_email_pattern = re.compile(r'([^<@>]+)\s*<([^ ,<@]+@[^> ,]+)>')

BIN
mail_fix_header_from/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 2.1 KiB

2
mail_outgoing/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import mail_outgoing_models

22
mail_outgoing/__openerp__.py

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': 'Outgoing mails menu',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
"category": "Discuss",
"support": "apps@it-projects.info",
'website': 'https://yelizariev.github.io',
'description': """
Allows to check outgoing mails, i.e. failed or delayed.
Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d
""",
'depends': ['mail'],
'data': [
'security/mail_outgoing.xml',
'security/ir.model.access.csv',
'mail_outgoing_views.xml',
],
'installable': False
}

25
mail_outgoing/mail_outgoing_models.py

@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv
class MailMessage(osv.Model):
_inherit = 'mail.message'
def check_access_rule(self, cr, uid, ids, operation, context=None):
group_all_emails = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, 'mail_outgoing.group_all_emails', context=context)
user = self.pool['res.users'].browse(cr, uid, uid, context)
user_groups = set(user.groups_id)
if user_groups.issuperset(group_all_emails):
return
return super(MailMessage, self).check_access_rule(cr, uid, ids, operation, context)
class MailMail(osv.Model):
_name = 'mail.mail'
_inherit = ['mail.mail', 'ir.needaction_mixin']
_needaction = True
def _needaction_domain_get(self, cr, uid, context=None):
return [('state', 'in', ['outgoing', 'exception'])]

34
mail_outgoing/mail_outgoing_views.xml

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_mail_outgoing" model="ir.actions.act_window">
<field name="name">Outgoing</field>
<field name="res_model">mail.mail</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
<field name="search_view_id" ref="mail.view_mail_search"/>
<field name="help" type="html">
<p>
Failed or delayed emails will be shown here. You will be able to retry failed emails and send delayed emails manually.
</p>
</field>
</record>
<menuitem name="Outgoing" id="menu_mail_outgoing" parent="mail.mail_feeds" action="action_mail_outgoing" sequence="20"/>
<!-- After installation of the module, open the related menu -->
<record id="action_mail_outgoing_menu" model="ir.actions.client">
<field name="name">Open Outgoing Menu</field>
<field name="tag">reload</field>
<field name="params" eval="{'menu_id': ref('mail_outgoing.menu_mail_outgoing')}"/>
</record>
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="action_mail_outgoing_menu"/>
<field name="state">open</field>
</record>
</data>
</openerp>

3
mail_outgoing/security/ir.model.access.csv

@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_mail_mail_system,mail.mail.system,model_mail_mail,mail_outgoing.group_all_emails,1,1,1,1

33
mail_outgoing/security/mail_outgoing.xml

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="res.groups" id="group_all_emails">
<field name="name">all_emails</field>
<field name="comment">Gets access to all emails. For example to check outgoing emails.</field>
</record>
<record model="ir.rule" id="rule_mail_mail_user">
<field name="name">mail.mail: user</field>
<field name="model_id" ref="mail.model_mail_mail"/>
<field name="domain_force">[('author_id', '=', user.partner_id.id)]</field>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="False"/>
<field name="global" eval="False"/>
</record>
<record model="ir.rule" id="rule_mail_mail_system">
<field name="name">mail.mail: system</field>
<field name="model_id" ref="mail.model_mail_mail"/>
<field name="domain_force">[(1, '=', 1)]</field>
<field name="groups" eval="[(4, ref('mail_outgoing.group_all_emails'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_create" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="global" eval="False"/>
</record>
</data>
</openerp>

BIN
mail_outgoing/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 2.1 KiB

4
mail_partner_lang/README.rst

@ -1,4 +0,0 @@
Use partner language in mail
============================
FIXME: there is issue with frozen dict in new odoo.

2
mail_partner_lang/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

14
mail_partner_lang/__openerp__.py

@ -1,14 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': 'Use partner language in mail',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
"category": "Discuss",
"support": "apps@it-projects.info",
'website': 'https://yelizariev.github.io',
'depends': ['mail'],
'data': [],
'installable': False,
}

88
mail_partner_lang/models.py

@ -1,88 +0,0 @@
# -*- coding: utf-8 -*-
from openerp.osv import osv
class MailThread(osv.Model):
_inherit = "mail.thread"
def message_track(self, cr, uid, ids, tracked_fields, initial_values, context={}):
def convert_for_display(value, col_info):
if not value and col_info['type'] == 'boolean':
return 'False'
if not value:
return ''
if col_info['type'] == 'many2one':
return value.name_get()[0][1]
if col_info['type'] == 'selection':
return dict(col_info['selection'])[value]
return value
def format_message(message_description, tracked_values):
message = ''
if message_description:
message = '<span>%s</span>' % message_description
for name, change in tracked_values.items():
message += '<div> &nbsp; &nbsp; &bull; <b>%s</b>: ' % change.get('col_info')
if change.get('old_value'):
message += '%s &rarr; ' % change.get('old_value')
message += '%s</div>' % change.get('new_value')
return message
if not tracked_fields:
return True
update_fields = [f for f in tracked_fields]
for browse_record in self.browse(cr, uid, ids, context=context):
p = getattr(browse_record, 'partner_id', None)
if p:
browse_record._context.update({'lang': p.lang})
initial = initial_values[browse_record.id]
changes = set()
tracked_values = {}
# update translation
tracked_fields = self._get_tracked_fields(cr, uid, update_fields, browse_record._context)
# generate tracked_values data structure: {'col_name': {col_info, new_value, old_value}}
for col_name, col_info in tracked_fields.items():
initial_value = initial[col_name]
record_value = getattr(browse_record, col_name)
if record_value == initial_value and getattr(self._all_columns[col_name].column, 'track_visibility', None) == 'always':
tracked_values[col_name] = dict(col_info=col_info['string'],
new_value=convert_for_display(record_value, col_info))
elif record_value != initial_value and (record_value or initial_value): # because browse null != False
if getattr(self._all_columns[col_name].column, 'track_visibility', None) in ['always', 'onchange']:
tracked_values[col_name] = dict(col_info=col_info['string'],
old_value=convert_for_display(initial_value, col_info),
new_value=convert_for_display(record_value, col_info))
if col_name in tracked_fields:
changes.add(col_name)
if not changes:
continue
# find subtypes and post messages or log if no subtype found
subtypes = []
for field, track_info in self._track.items():
if field not in changes:
continue
for subtype, method in track_info.items():
if method(self, cr, uid, browse_record, context):
subtypes.append(subtype)
posted = False
for subtype in subtypes:
subtype_rec = self.pool.get('ir.model.data').xmlid_to_object(cr, uid, subtype, context=context)
if not (subtype_rec and subtype_rec.exists()):
_logger.debug('subtype %s not found' % subtype)
continue
message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)
self.message_post(cr, uid, browse_record.id, body=message, subtype=subtype, context=context)
posted = True
if not posted:
message = format_message('', tracked_values)
self.message_post(cr, uid, browse_record.id, body=message, context=context)
return True

BIN
mail_partner_lang/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 2.1 KiB

67
mail_sent/i18n/pt.po

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_sent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-29 18:57+0000\n"
"PO-Revision-Date: 2017-03-29 18:57+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: mail_sent
#: model:ir.actions.client,help:mail_sent.action_mail_sent_feeds
msgid "<p>\n"
" No message found and no message sent yet.\n"
" </p><p>\n"
" Click on the top-right icon to compose a message. This\n"
" message will be sent by email if it's an internal contact.\n"
" </p>\n"
" "
msgstr "<p>\n"
" Nenhuma mensagem encontrada e nenhuma enviada ainda.\n"
" </p><p>\n"
" Clique no ícone no canto superior direito para compor uma nova mensagem.\n"
" Esta mensagem será enviada por e-mail se não for um contato interno.\n"
" </p>\n"
" "
#. module: mail_sent
#: model:ir.model,name:mail_sent.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Assistente de composição de Email"
#. module: mail_sent
#: model:ir.model,name:mail_sent.model_mail_message
msgid "Message"
msgstr "Mensagem"
#. module: mail_sent
#: model:ir.model,name:mail_sent.model_mail_notification
msgid "Notifications"
msgstr "Notificações"
#. module: mail_sent
#: model:ir.actions.client,name:mail_sent.action_mail_sent_feeds
#: model:ir.ui.menu,name:mail_sent.mail_sentfeeds
#: field:mail.compose.message,sent:0
#: field:mail.message,sent:0
msgid "Sent"
msgstr "Enviados"
#. module: mail_sent
#: help:mail.message,sent:0
msgid "Was message sent to someone"
msgstr "Foi enviada mensagem para alguém"
#. module: mail_sent
#: help:mail.compose.message,sent:0
msgid "dummy field to fix inherit error"
msgstr "campo fictício para corrigir o erro da herança"

67
mail_sent/i18n/pt_BR.po

@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_sent
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-03-29 18:57+0000\n"
"PO-Revision-Date: 2017-03-29 18:57+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: mail_sent
#: model:ir.actions.client,help:mail_sent.action_mail_sent_feeds
msgid "<p>\n"
" No message found and no message sent yet.\n"
" </p><p>\n"
" Click on the top-right icon to compose a message. This\n"
" message will be sent by email if it's an internal contact.\n"
" </p>\n"
" "
msgstr "<p>\n"
" Nenhuma mensagem encontrada e nenhuma enviada ainda.\n"
" </p><p>\n"
" Clique no ícone no canto superior direito para compor uma nova mensagem.\n"
" Esta mensagem será enviada por e-mail se não for um contato interno.\n"
" </p>\n"
" "
#. module: mail_sent
#: model:ir.model,name:mail_sent.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Assistente de Composição de Email"
#. module: mail_sent
#: model:ir.model,name:mail_sent.model_mail_message
msgid "Message"
msgstr "Mensagem"
#. module: mail_sent
#: model:ir.model,name:mail_sent.model_mail_notification
msgid "Notifications"
msgstr "Notificações"
#. module: mail_sent
#: model:ir.actions.client,name:mail_sent.action_mail_sent_feeds
#: model:ir.ui.menu,name:mail_sent.mail_sentfeeds
#: field:mail.compose.message,sent:0
#: field:mail.message,sent:0
msgid "Sent"
msgstr "Enviados"
#. module: mail_sent
#: help:mail.message,sent:0
msgid "Was message sent to someone"
msgstr "Foi enviada mensagem para alguém"
#. module: mail_sent
#: help:mail.compose.message,sent:0
msgid "dummy field to fix inherit error"
msgstr "campo fictício para corrigir o erro da herança"

2
mail_todo_custom/README.rst

@ -1,2 +0,0 @@
Mark unstarred email as read, remove filter in 'To-do' folder
=============================================================

0
mail_todo_custom/__init__.py

14
mail_todo_custom/__openerp__.py

@ -1,14 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': "Mark unstarred email as read, remove filter in 'To-do' folder",
'version': '1.0',
'author': 'IT-Projects LLC',
'license': 'LGPL-3',
"support": "apps@it-projects.info",
'website': "https://yelizariev.github.io",
"category": "Discuss",
'depends': ['mail'],
'data': ['mail_todo_custom.xml'],
'demo': [],
'installable': False,
}

25
mail_todo_custom/mail_todo_custom.xml

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend_inherited_mail_todo_custom" name="Mail todo custom" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/mail_todo_custom/static/src/js/mail_todo_custom.js"></script>
</xpath>
</template>
<record id="mail.action_mail_star_feeds" model="ir.actions.client">
<field name="context">
{
'default_model': 'res.users',
'default_res_id': uid,
'thread_model': 'res.partner',
'search_default_message_unread': False,
'view_todo': True
}
</field>
</record>
</data>
</openerp>

44
mail_todo_custom/static/src/js/mail_todo_custom.js

@ -1,44 +0,0 @@
openerp.mail_todo_custom = function(session) {
var mail = session.mail;
mail.ThreadMessage.include({
on_star: function (event) {
event.stopPropagation();
var self=this;
var button = self.$('.oe_star:first');
this.ds_message.call('set_message_starred', [[self.id], !self.is_favorite, true])
.then(function (star) {
self.is_favorite=star;
if (self.is_favorite) {
button.addClass('oe_starred');
} else {
button.removeClass('oe_starred');
}
if (self.options.view_inbox && self.is_favorite) {
self.on_message_read_unread(true);
}
else {
self.check_for_rerender();
}
if (self.options.view_todo && !self.is_favorite) {
self.on_message_read_unread(true);
}
});
return false;
},
});
mail.Widget.include({
init: function (parent, action) {
this._super(parent, action);
this.action.params.view_todo = this.action.context.view_todo || false;
},
});
};

2
mass_mailing_extra/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

23
mass_mailing_extra/__openerp__.py

@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': 'Improvements for mass mailing',
'version': '1.0.0',
'author': 'IT-Projects LLC, Ivan Yelizariev',
'license': 'LGPL-3',
"category": "Discuss",
"support": "apps@it-projects.info",
'website': 'https://yelizariev.github.io',
'description': """
Modules adds:
* partners info in mail.mail.statistics tree
* partners info in mail.mail.statistics form
Tested on 8.0 f8d5a6727d3e8d428d9bef93da7ba6b11f344284
""",
'depends': ['mass_mailing'],
'data': [
'views.xml',
],
'installable': False
}

41
mass_mailing_extra/models.py

@ -1,41 +0,0 @@
# -*- coding: utf-8 -*-
from openerp import api, models, fields
class MailMailStats(models.Model):
_inherit = 'mail.mail.statistics'
partner_ids = fields.Many2many('res.partner', related='mail_mail_id.recipient_ids', string='Partners (Mail)')
@api.multi
def _get_partner_id(self):
for r in self:
r._get_partner_id_one()
@api.multi
def _get_partner_id_one(self):
self.ensure_one()
if self.model == 'res.partner':
self.partner_id = self.res_id
else:
self.partner_id = None
partner_id = fields.Many2one('res.partner', compute=_get_partner_id, string='Partner (Document ID)')
@api.multi
def _get_partners(self):
for r in self:
r._get_partners_one()
@api.multi
def _get_partners_one(self):
self.ensure_one()
res = {}
for p in self.partner_ids:
res[p.id] = p
if self.partner_id and self.partner_id.id not in res:
res[self.partner_id.id] = self.partner_id
self.partners = ', '.join([('%s <%s>' % (p.name, p.email)) for id, p in res.items()])
partners = fields.Char('Partners', compute=_get_partners)

BIN
mass_mailing_extra/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 2.1 KiB

38
mass_mailing_extra/views.xml

@ -1,38 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_mail_mail_statistics_form">
<field name="name">mail.mail.statistics.form</field>
<field name="model">mail.mail.statistics</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<notebook>
<page string="Partners">
<group>
<label for="partners" string="Partners (summary)"/>
<field name="partners" readonly="1" nolabel="1"/>
<field name="partner_id" readonly="1"/>
</group>
<label for="partner_ids"/>
<field name="partner_ids" readonly="1"/>
</page>
</notebook>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_mail_mail_statistics_tree">
<field name="name">mail.mail.statistics.tree</field>
<field name="model">mail.mail.statistics</field>
<field name="inherit_id" ref="mass_mailing.view_mail_mail_statistics_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='mail_mail_id_int']" position="before">
<field name="partners"/>
</xpath>
</field>
</record>
</data>
</openerp>

1
res_partner_strip_email/README.rst

@ -1 +0,0 @@
Trim email field in partner form.

2
res_partner_strip_email/__init__.py

@ -1,2 +0,0 @@
# -*- coding: utf-8 -*-
from . import models

22
res_partner_strip_email/__openerp__.py

@ -1,22 +0,0 @@
# -*- coding: utf-8 -*-
{
'name': "Trim partner's email",
'summary': "",
'author': "IT-Projects LLC, Ivan Yelizariev",
'license': 'LGPL-3',
"support": "apps@it-projects.info",
'website': "https://yelizariev.github.io",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml
# for the full list
"category": "Discuss",
'version': '1.0.0',
# any module necessary for this one to work correctly
'depends': ['base'],
# always loaded
'data': [],
'installable': False,
}

29
res_partner_strip_email/models.py

@ -1,29 +0,0 @@
# -*- coding: utf-8 -*-
from openerp import api
from openerp import models
class ResPartnerStripEmail(models.Model):
_inherit = 'res.partner'
@api.multi
def write(self, vals):
for r in self:
r.write_one(vals)
@api.multi
def write_one(self, vals):
self.ensure_one()
vals = self._check_email_field(vals)
return super(ResPartnerStripEmail, self).write(vals)
@api.model
def create(self, vals):
vals = self._check_email_field(vals)
return super(ResPartnerStripEmail, self).create(vals)
def _check_email_field(self, vals):
if vals.get('email'):
vals['email'] = vals['email'].strip()
return vals

BIN
res_partner_strip_email/static/description/icon.png

Before

Width: 100  |  Height: 100  |  Size: 3.0 KiB

Loading…
Cancel
Save