Browse Source

Merge pull request #369 from yelizariev/11.0-cleanup-3

commit is created by 👷‍♂️ Merge Bot: https://odoo-devops.readthedocs.io/en/latest/git/github-merge-bot.html
11.0
Mitchell Admin 2 years ago
committed by GitHub
parent
commit
874757a7d5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      mail_check_immediately/README.rst
  2. 1
      mail_check_immediately/__init__.py
  3. 15
      mail_check_immediately/__manifest__.py
  4. 4
      mail_check_immediately/doc/changelog.rst
  5. 80
      mail_check_immediately/models.py
  6. BIN
      mail_check_immediately/static/description/icon.png
  7. 49
      mail_check_immediately/static/description/index.html
  8. BIN
      mail_check_immediately/static/description/issue.png
  9. BIN
      mail_check_immediately/static/description/screenshot.png
  10. 60
      mail_check_immediately/static/src/js/main.js
  11. 29
      mail_check_immediately/static/src/xml/main.xml
  12. 16
      mail_check_immediately/views.xml
  13. 48
      mail_fix_553/README.rst
  14. 1
      mail_fix_553/__init__.py
  15. 13
      mail_fix_553/__manifest__.py
  16. 15
      mail_fix_553/data.xml
  17. 219
      mail_fix_553/mail_fix_553.py
  18. BIN
      mail_fix_553/static/description/icon.png
  19. 31
      mail_recovery/README.rst
  20. 0
      mail_recovery/__init__.py
  21. 16
      mail_recovery/__manifest__.py
  22. 17
      mail_recovery/data.xml
  23. 7
      mail_recovery/doc/changelog.rst
  24. 11
      mail_recovery/doc/index.rst
  25. 14
      mail_recovery/i18n/mail_recovery.pot
  26. BIN
      mail_recovery/images/mail_recovery.png
  27. BIN
      mail_recovery/static/description/black.png
  28. BIN
      mail_recovery/static/description/continue.png
  29. BIN
      mail_recovery/static/description/icon.png
  30. 82
      mail_recovery/static/description/index.html
  31. BIN
      mail_recovery/static/description/reopen.png
  32. BIN
      mail_recovery/static/description/typing.png
  33. 25
      mail_recovery/static/src/js/mail_recovery.js
  34. 25
      mail_reply/README.rst
  35. 0
      mail_reply/__init__.py
  36. 20
      mail_reply/__manifest__.py
  37. 4
      mail_reply/doc/changelog.rst
  38. 28
      mail_reply/doc/index.rst
  39. 27
      mail_reply/i18n/es.po
  40. 22
      mail_reply/i18n/mail_reply.pot
  41. BIN
      mail_reply/images/mail_reply.jpg
  42. BIN
      mail_reply/static/description/icon.png
  43. BIN
      mail_reply/static/description/inbox.png
  44. 31
      mail_reply/static/description/index.html
  45. 51
      mail_reply/static/src/js/mail_reply.js
  46. 16
      mail_reply/static/src/xml/reply_button.xml
  47. 17
      mail_reply/templates.xml
  48. 1
      mail_reply/tests/__init__.py
  49. 40
      mail_reply/tests/test_default.py
  50. 10
      res_partner_company_messages/README.rst
  51. 1
      res_partner_company_messages/__init__.py
  52. 15
      res_partner_company_messages/__manifest__.py
  53. 26
      res_partner_company_messages/i18n/de.po
  54. 25
      res_partner_company_messages/i18n/es.po
  55. 20
      res_partner_company_messages/i18n/res_partner_company_messages.pot
  56. 27
      res_partner_company_messages/i18n/ru.po
  57. BIN
      res_partner_company_messages/images/child.png
  58. BIN
      res_partner_company_messages/images/parent.png
  59. 20
      res_partner_company_messages/models.py
  60. BIN
      res_partner_company_messages/static/description/icon.png
  61. 5
      res_partner_company_messages/views.xml
  62. 20
      res_partner_mails_count/README.rst
  63. 1
      res_partner_mails_count/__init__.py
  64. 22
      res_partner_mails_count/__manifest__.py
  65. 127
      res_partner_mails_count/i18n/de.po
  66. 127
      res_partner_mails_count/i18n/es.po
  67. 119
      res_partner_mails_count/i18n/res_partner_mails_count.pot
  68. 130
      res_partner_mails_count/i18n/ru.po
  69. BIN
      res_partner_mails_count/images/1.png
  70. 23
      res_partner_mails_count/models.py
  71. BIN
      res_partner_mails_count/static/description/1.png
  72. BIN
      res_partner_mails_count/static/description/2.png
  73. BIN
      res_partner_mails_count/static/description/3.png
  74. BIN
      res_partner_mails_count/static/description/icon.png
  75. 36
      res_partner_mails_count/static/description/index.html
  76. 38
      res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js
  77. 62
      res_partner_mails_count/templates.xml
  78. 3
      res_partner_mails_count/tests/__init__.py
  79. 62
      res_partner_mails_count/tests/test_mail.py
  80. 30
      res_partner_mails_count/tests/test_phantom.py
  81. 18
      res_partner_mails_count/views/res_partner_mails_count.xml

8
mail_check_immediately/README.rst

@ -1,8 +0,0 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
Check mail immediately
======================
Description: https://apps.odoo.com/apps/modules/8.0/mail_check_immediately/

1
mail_check_immediately/__init__.py

@ -1 +0,0 @@
from . import models

15
mail_check_immediately/__manifest__.py

@ -1,15 +0,0 @@
{
"name": "Check mail immediately",
"version": "11.0.1.0.1",
"author": "IT-Projects LLC, Ivan Yelizariev",
"license": "Other OSI approved licence", # MIT
"category": "Discuss",
"support": "apps@itpp.dev",
"website": "https://twitter.com/yelizariev",
"price": 9.00,
"currency": "EUR",
"depends": ["base", "web", "fetchmail", "mail"],
"data": ["views.xml"],
"qweb": ["static/src/xml/main.xml"],
"installable": False,
}

4
mail_check_immediately/doc/changelog.rst

@ -1,4 +0,0 @@
`1.0.1`
-------
- FIX: incorrectly displayed last updated time when multiple threads (--workers)

80
mail_check_immediately/models.py

@ -1,80 +0,0 @@
import datetime
from odoo import api, exceptions, fields, models, tools
from odoo.tools.translate import _
class FetchMailServer(models.Model):
_inherit = "fetchmail.server"
_name = "fetchmail.server"
_last_updated = None
run_time = fields.Datetime(string="Launch time")
def _run_time(self):
if not self._last_updated:
self._last_updated = tools.datetime.now()
src_tstamp_str = self._last_updated.strftime(
tools.misc.DEFAULT_SERVER_DATETIME_FORMAT
)
src_format = tools.misc.DEFAULT_SERVER_DATETIME_FORMAT
dst_format = tools.misc.DEFAULT_SERVER_DATETIME_FORMAT
dst_tz_name = self._context.get("tz") or self.env.user.tz
_now = tools.misc.server_to_local_timestamp(
src_tstamp_str, src_format, dst_format, dst_tz_name
)
return _now
@api.model
def _fetch_mails(self):
if self._context.get("run_fetchmail_manually"):
# if interval less than 5 seconds
if self._last_updated and (
datetime.datetime.now() - self._last_updated
) < datetime.timedelta(0, 5):
raise exceptions.Warning(
_("Error"), _("Task can be started no earlier than 5 seconds.")
)
super(FetchMailServer, self)._fetch_mails()
res = (
self.env["fetchmail.server"]
.sudo()
.with_context(tz=self.env.user.tz)
.search([("state", "=", "done")])
)
if res:
res[0].run_time = self._run_time()
class FetchMailImmediately(models.AbstractModel):
_name = "fetch_mail.imm"
@api.model
def get_last_update_time(self):
res = (
self.env["fetchmail.server"]
.sudo()
.with_context(tz=self.env.user.tz)
.search([("state", "=", "done")])
)
array = [r.run_time for r in res]
if array:
return array[0]
else:
return None
@api.model
def run_fetchmail_manually(self):
fetchmail_task = self.env.ref("fetchmail.ir_cron_mail_gateway_action")
fetchmail_model = self.env["fetchmail.server"].sudo()
fetchmail_task._try_lock()
fetchmail_model.with_context(run_fetchmail_manually=True)._fetch_mails()

BIN
mail_check_immediately/static/description/icon.png

Before

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

49
mail_check_immediately/static/description/index.html

@ -1,49 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Check mail immediately</h2>
<h3 class="oe_slogan">Keep your inbox up to date</h3>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="screenshot.png?"/>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2>Protect your business</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<a href="https://github.com/odoo/odoo/issues/7464">Sometimes</a> odoo mail fetching system doesn't work for really long time. It could be a real problem, if you will not notice it on time. Until this issue is fixed, you can restart odoo every time when you see that last fetching time is more than 5 minutes.
</p>
</div>
<div class="oe_span6">
<div class="oe_picture">
<img src="issue.png?3"/>
</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>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
</div>
</section>

BIN
mail_check_immediately/static/description/issue.png

Before

Width: 217  |  Height: 140  |  Size: 8.5 KiB

BIN
mail_check_immediately/static/description/screenshot.png

Before

Width: 840  |  Height: 447  |  Size: 88 KiB

60
mail_check_immediately/static/src/js/main.js

@ -1,60 +0,0 @@
openerp.mail_check_immediately = function(instance, local) {
"use strict";
instance.mail.Wall.include({
init: function() {
this._super.apply(this, arguments);
var _this = this;
this.imm_model = new instance.web.Model("fetch_mail.imm");
this.events["click a.oe_fetch_new_mails"] = function() {
_this.run_fetchmail_manually();
};
},
start: function() {
var _this = this;
this._super();
this.get_last_fetched_time();
this.get_time_loop = setInterval(function() {
_this.get_last_fetched_time();
}, 30000);
},
run_fetchmail_manually: function() {
var _this = this;
this.imm_model
.call("run_fetchmail_manually", {
context: new instance.web.CompoundContext(),
})
.then(function() {
_this.get_last_fetched_time();
});
},
get_last_fetched_time: function() {
var _this = this;
this.imm_model
.call("get_last_update_time", {
context: new instance.web.CompoundContext(),
})
.then(function(res) {
var value = null;
if (res) value = $.timeago(res);
value = value || "undefined";
_this.$el
.find("span.oe_view_manager_fetch_mail_imm_field")
.html(value);
});
},
destroy: function() {
clearInterval(this.get_time_loop);
this._super.apply(this, arguments);
},
});
};

29
mail_check_immediately/static/src/xml/main.xml

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<t t-name="fetch_mail_immediately.header">
<tr class="oe_header_row">
<td t-att-colspan="colspan or '3'">
<div class="oe_view_manager_fetch_mail_imm">
<em>
<span>Mails fetched:</span>
<a
href="#"
class="oe_fetch_new_mails"
title="Click to fetch mails now"
>
<span class="oe_view_manager_fetch_mail_imm_field" />
</a>
</em>
</div>
</td>
<td />
</tr>
</t>
<t t-extend="mail.wall">
<t t-jquery="tr.oe_header_row_top" t-operation="after">
<t t-call="fetch_mail_immediately.header">
<t t-set="colspan" t-value="2" />
</t>
</t>
</t>
</templates>

16
mail_check_immediately/views.xml

@ -1,16 +0,0 @@
<openerp>
<data>
<template
id="assets_backend_inherited_check_mail"
name="Check mail immediately bar"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/mail_check_immediately/static/src/js/main.js"
/>
</xpath>
</template>
</data>
</openerp>

48
mail_fix_553/README.rst

@ -1,48 +0,0 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
Fix mail error 553
==================
Module updates 'FROM' field to portal@MYDOMAIN.COM value in order to fix 553 error on a mail service that checks FROM field.
E.g:
* Customer send email from USER@CUSTOMER.com to info@MYDOMAIN.COM
* odoo accept email and try to send notifcation to related odoo users. E.g to admin@gmail.com.
* By default odoo prepare notification email with parameters as follows:
* FROM: user@CUSTOMER.com
* TO: admin@gmail.com
if you mail service provider, e.g. pdd.yandex.ru, doesn't allow emails with a FROM value differ from ...@MYDOMAIN.COM, then you get 553. This is why you need to update FROM value to portal@MYDOMAIN.COM
Configuration
=============
You can configure default alias at Settings -> System Parameters -> mail.catchall.alias_from
You can configure name for default alias at Settings -> System Parameters -> mail.catchall.name_alias_from
You can configure name for default alias at Settings -> System Parameters -> mail.catchall.name_alias_from
Known issues / Roadmap
======================
The module is consist of redefined send function from mail.mail
model. So it is just copy pasted source code with some
modification. This function is changed very rarely, but sometime it
can happens and the module should be updated. You can check commits
for mail_mail.py here:
https://github.com/odoo/odoo/commits/8.0/addons/mail/mail_mail.py
Tested on `Odoo 8.0 <https://github.com/odoo/odoo/commit/d023c079ed86468436f25da613bf486a4a17d625>`_
Status
======
Related issues at odoo's tracker:
* https://github.com/odoo/odoo/issues/5864
* https://github.com/odoo/odoo/issues/3347
Fix: https://github.com/odoo-dev/odoo/commit/a4597fe34fcfa8dae28b156410080346bb33af33

1
mail_fix_553/__init__.py

@ -1 +0,0 @@
from . import mail_fix_553

13
mail_fix_553/__manifest__.py

@ -1,13 +0,0 @@
# pylint: disable=manifest-version-format
{
"name": "Fix mail error 553",
"version": "0.3",
"author": "IT-Projects LLC, Ivan Yelizariev",
"license": "Other OSI approved licence", # MIT
"category": "Discuss",
"support": "apps@itpp.dev",
"website": "https://yelizariev.github.io",
"depends": ["base", "mail"],
"data": ["data.xml"],
"installable": False,
}

15
mail_fix_553/data.xml

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data noupdate="1">
<!-- Catchall Email Alias -->
<record id="icp_mail_catchall_alias_from" model="ir.config_parameter">
<field name="key">mail.catchall.alias_from</field>
<field name="value">portal</field>
</record>
<!-- Name for Catchall Email Alias -->
<record id="icp_mail_catchall_name_alias_from" model="ir.config_parameter">
<field name="key">mail.catchall.name_alias_from</field>
<field name="value">Odoo</field>
</record>
</data>
</openerp>

219
mail_fix_553/mail_fix_553.py

@ -1,219 +0,0 @@
# pylint: disable=old-api7-method-defined,invalid-commit
import base64
import logging
import re
from email.utils import formataddr
from odoo import SUPERUSER_ID, tools
from odoo.osv import osv
from odoo.tools.safe_eval import safe_eval
from odoo.tools.translate import _
from odoo.addons.base.ir.ir_mail_server import MailDeliveryException
_logger = logging.getLogger(__name__)
class MailMail(osv.Model):
_inherit = "mail.mail"
def send(
self, cr, uid, ids, auto_commit=False, raise_exception=False, context=None
):
# copy-paste from addons/mail/mail_mail.py
""" Sends the selected emails immediately, ignoring their current
state (mails that have already been sent should not be passed
unless they should actually be re-sent).
Emails successfully delivered are marked as 'sent', and those
that fail to be deliver are marked as 'exception', and the
corresponding error mail is output in the server logs.
:param bool auto_commit: whether to force a commit of the mail status
after sending each mail (meant only for scheduler processing);
should never be True during normal transactions (default: False)
:param bool raise_exception: whether to raise an exception if the
email sending process has failed
:return: True
"""
# NEW STUFF
catchall_alias = self.pool["ir.config_parameter"].get_param(
cr, uid, "mail.catchall.alias_from", context=context
)
catchall_alias_name = self.pool["ir.config_parameter"].get_param(
cr, uid, "mail.catchall.name_alias_from", context=context
)
catchall_domain = self.pool["ir.config_parameter"].get_param(
cr, uid, "mail.catchall.domain", context=context
)
correct_email_from = r"@%s>?\s*$" % catchall_domain
default_email_from = "{}@{}".format(catchall_alias, catchall_domain)
context = dict(context or {})
ir_mail_server = self.pool.get("ir.mail_server")
ir_attachment = self.pool["ir.attachment"]
for mail in self.browse(cr, SUPERUSER_ID, ids, context=context):
try:
# TDE note: remove me when model_id field is present on mail.message - done here to avoid doing it multiple times in the sub method
if mail.model:
model_id = self.pool["ir.model"].search(
cr, SUPERUSER_ID, [("model", "=", mail.model)], context=context
)[0]
model = self.pool["ir.model"].browse(
cr, SUPERUSER_ID, model_id, context=context
)
else:
model = None
if model:
context["model_name"] = model.name
# load attachment binary data with a separate read(), as prefetching all
# `datas` (binary field) could bloat the browse cache, triggerring
# soft/hard mem limits with temporary data.
attachment_ids = [a.id for a in mail.attachment_ids]
attachments = [
(a["datas_fname"], base64.b64decode(a["datas"]))
for a in ir_attachment.read(
cr, SUPERUSER_ID, attachment_ids, ["datas_fname", "datas"]
)
]
# specific behavior to customize the send email for notified partners
email_list = []
if mail.email_to:
email_list.append(
self.send_get_email_dict(cr, uid, mail, context=context)
)
for partner in mail.recipient_ids:
email_list.append(
self.send_get_email_dict(
cr, uid, mail, partner=partner, context=context
)
)
# headers
headers = {}
bounce_alias = self.pool["ir.config_parameter"].get_param(
cr, uid, "mail.bounce.alias", context=context
)
catchall_domain = self.pool["ir.config_parameter"].get_param(
cr, uid, "mail.catchall.domain", context=context
)
if bounce_alias and catchall_domain:
if mail.model and mail.res_id:
headers["Return-Path"] = "%s-%d-%s-%d@%s" % (
bounce_alias,
mail.id,
mail.model,
mail.res_id,
catchall_domain,
)
else:
headers["Return-Path"] = "%s-%d@%s" % (
bounce_alias,
mail.id,
catchall_domain,
)
if mail.headers:
try:
headers.update(safe_eval(mail.headers))
except Exception:
pass
# Writing on the mail object may fail (e.g. lock on user) which
# would trigger a rollback *after* actually sending the email.
# To avoid sending twice the same email, provoke the failure earlier
mail.write({"state": "exception"})
mail_sent = False
# build an RFC2822 email.message.Message object and send it without queuing
res = None
for email in email_list:
# NEW STUFF
email_from = mail.email_from
if re.search(correct_email_from, email_from) is None:
email_from = default_email_from
if catchall_alias_name:
email_from = formataddr((catchall_alias_name, email_from))
msg = ir_mail_server.build_email(
email_from=email_from, # NEW STUFF
email_to=email.get("email_to"),
subject=email.get("subject"),
body=email.get("body"),
body_alternative=email.get("body_alternative"),
email_cc=tools.email_split(mail.email_cc),
reply_to=mail.reply_to,
attachments=attachments,
message_id=mail.message_id,
references=mail.references,
object_id=mail.res_id
and ("{}-{}".format(mail.res_id, mail.model)),
subtype="html",
subtype_alternative="plain",
headers=headers,
)
try:
res = ir_mail_server.send_email(
cr,
uid,
msg,
mail_server_id=mail.mail_server_id.id,
context=context,
)
except AssertionError as error:
if str(error) == ir_mail_server.NO_VALID_RECIPIENT:
# No valid recipient found for this particular
# mail item -> ignore error to avoid blocking
# delivery to next recipients, if any. If this is
# the only recipient, the mail will show as failed.
_logger.warning(
"Ignoring invalid recipients for mail.mail %s: %s",
mail.message_id,
email.get("email_to"),
)
else:
raise
if res:
mail.write({"state": "sent", "message_id": res})
mail_sent = True
# /!\ can't use mail.state here, as mail.refresh() will cause an error
# see revid:odo@openerp.com-20120622152536-42b2s28lvdv3odyr in 6.1
if mail_sent:
_logger.info(
"Mail with ID %r and Message-Id %r successfully sent",
mail.id,
mail.message_id,
)
self._postprocess_sent_message(
cr, uid, mail, context=context, mail_sent=mail_sent
)
except MemoryError:
# prevent catching transient MemoryErrors, bubble up to notify user or abort cron job
# instead of marking the mail as failed
_logger.exception(
"MemoryError while processing mail with ID %r and Msg-Id %r. "
"Consider raising the --limit-memory-hard startup option",
mail.id,
mail.message_id,
)
raise
except Exception as e:
_logger.exception("failed sending mail.mail %s", mail.id)
mail.write({"state": "exception"})
self._postprocess_sent_message(
cr, uid, mail, context=context, mail_sent=False
)
if raise_exception:
if isinstance(e, AssertionError):
# get the args of the original error, wrap into a value and throw a MailDeliveryException
# that is an except_orm, with name and value as arguments
value = ". ".join(e.args)
raise MailDeliveryException(_("Mail Delivery Failed"), value)
raise
if auto_commit is True:
cr.commit()
return True

BIN
mail_fix_553/static/description/icon.png

Before

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

31
mail_recovery/README.rst

@ -1,31 +0,0 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
===============
Mail Recovery
===============
Backup and recover unsent message. It works via localStorage.
TODO
====
* add support for *full mail composer*
Questions?
==========
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
Contributors
============
* Ildar Nasyrov <nasyrov@it-projects.info>
Further information
===================
Odoo Apps Store: https://apps.odoo.com/apps/modules/9.0/mail_recovery/
Tested on `Odoo 9.0 <https://github.com/odoo/odoo/commit/fd9eb2e4819031c6758c021f4c335b591367632d>`_

0
mail_recovery/__init__.py

16
mail_recovery/__manifest__.py

@ -1,16 +0,0 @@
{
"name": "Mail Recovery",
"summary": """Backup and recover unsent message""",
"author": "IT-Projects LLC, Ildar Nasyrov",
"license": "Other OSI approved licence", # MIT
"price": 190.00,
"currency": "EUR",
"support": "apps@itpp.dev",
"website": "https://twitter.com/nasyrov_ildar",
"category": "Discuss",
"images": ["images/mail_recovery.png"],
"version": "11.0.1.0.0",
"depends": ["mail"],
"data": ["data.xml"],
"installable": False,
}

17
mail_recovery/data.xml

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<template
id="assets_backend"
name="message storage"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/mail_recovery/static/src/js/mail_recovery.js"
/>
</xpath>
</template>
</data>
</openerp>

7
mail_recovery/doc/changelog.rst

@ -1,7 +0,0 @@
Updates
=======
`1.0.0`
-------
- Init version

11
mail_recovery/doc/index.rst

@ -1,11 +0,0 @@
===============
Mail recovery
===============
Usage
=====
* Start typing new message
* Force close browser window or tab
* Click on message input
* The message is recovered

14
mail_recovery/i18n/mail_recovery.pot

@ -1,14 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \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"

BIN
mail_recovery/images/mail_recovery.png

Before

Width: 750  |  Height: 371  |  Size: 384 KiB

BIN
mail_recovery/static/description/black.png

Before

Width: 600  |  Height: 299  |  Size: 1.2 KiB

BIN
mail_recovery/static/description/continue.png

Before

Width: 600  |  Height: 219  |  Size: 38 KiB

BIN
mail_recovery/static/description/icon.png

Before

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

82
mail_recovery/static/description/index.html

@ -1,82 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Mail recovery</h2>
<h3 class="oe_slogan">Backup and recover unsent message</h3>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span4">
<p class="oe_mt32">
Imagine that you are typing a message to someone. Probably a big message.
</p>
</div>
<div class="oe_span8">
<div class="oe_row_img oe_centered">
<img class="oe_demo oe_picture oe_screenshot" src="typing.png"/>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<div class="oe_row_img oe_centered">
<img class="oe_demo oe_picture oe_screenshot" src="black.png"/>
</div>
</div>
<div class="oe_span4">
<p class="oe_mt32">
And then something wrong happens. You close browser, electricity is turned off or whatever.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span4">
<p class="oe_mt32">
Don't worry! Open browser again and click Reply icon.
</p>
</div>
<div class="oe_span8">
<div class="oe_row_img oe_centered">
<img class="oe_demo oe_picture oe_screenshot" src="reopen.png"/>
</div>
</div>
<div class="oe_span4">
<p class="oe_mt32">
You can finish your message from point where it was interrupted.
</p>
</div>
<div class="oe_span8">
<div class="oe_row_img oe_centered">
<img class="oe_demo oe_picture oe_screenshot" src="continue.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>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
</div>
</section>

BIN
mail_recovery/static/description/reopen.png

Before

Width: 600  |  Height: 240  |  Size: 54 KiB

BIN
mail_recovery/static/description/typing.png

Before

Width: 600  |  Height: 299  |  Size: 48 KiB

25
mail_recovery/static/src/js/mail_recovery.js

@ -1,25 +0,0 @@
odoo.define("mail_recovery", function(require) {
"use strict";
var composer = require("mail.composer");
composer.BasicComposer.include({
init: function() {
this._super.apply(this, arguments);
this.events["focus .o_composer_input textarea"] = "on_focus_textarea";
this.events["keyup .o_composer_input textarea"] = "on_keyup_textarea";
},
on_focus_textarea: function(event) {
var $input = $(event.target);
if (!$input.val()) {
$input.val(window.localStorage.message_storage);
}
},
on_keyup_textarea: function(event) {
window.localStorage.message_storage = $(event.target).val();
},
send_message: function(event) {
window.localStorage.message_storage = "";
return this._super(event);
},
});
});

25
mail_reply/README.rst

@ -1,25 +0,0 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
==========================
Always show reply button
==========================
The module allows to reply to any message. Out-of-box odoo shows reply button for messages attached to some record.
Questions?
==========
To get an assistance on this module contact us by email :arrow_right: help@itpp.dev
Contributors
============
* Pavel Romanchenko <apps@it-projects.info>
===================
Odoo Apps Store: https://apps.odoo.com/apps/modules/11.0/mail_reply/
Tested on `Odoo 11.0 <https://github.com/odoo/odoo/commit/ecbf7aa4714479229658d14cce28fa00376ed390>`_

0
mail_reply/__init__.py

20
mail_reply/__manifest__.py

@ -1,20 +0,0 @@
{
"name": """Always show reply button""",
"summary": """Got a message out of a Record? Now you can reply to it too!""",
"category": "Discuss",
"images": ["images/mail_reply.jpg"],
"version": "11.0.1.0.0",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://itpp.dev",
"license": "Other OSI approved licence", # MIT
"price": 40.00,
"currency": "EUR",
"depends": ["mail_base"],
"external_dependencies": {"python": [], "bin": []},
"data": ["templates.xml"],
"qweb": ["static/src/xml/reply_button.xml"],
"demo": [],
"installable": False,
"auto_install": False,
}

4
mail_reply/doc/changelog.rst

@ -1,4 +0,0 @@
`1.0.0`
-------
- Init version

28
mail_reply/doc/index.rst

@ -1,28 +0,0 @@
===================
Show reply button
===================
Installation
============
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way
Configuration
=============
This module does not require special configuration.
Usage
=====
* Open ``[[ Discuss ]]`` menu
* RESULT: you can see, that messages not attached to any record now have Reply button
* Note: messages from Channels (including Direct messages) don’t have this button. You need to open corresponding channel instead.
* To easily know and navigate to corresponding channel, you need to get module `Show message recipients <https://apps.odoo.com/apps/modules/11.0/mail_to/>`__.
* Note: to see just sent message use one of the following modules:
* SentBox: https://apps.odoo.com/apps/modules/11.0/mail_sent/
* Archive: https://apps.odoo.com/apps/modules/11.0/mail_archives/
* All Messages: https://www.odoo.com/apps/modules/11.0/mail_all/

27
mail_reply/i18n/es.po

@ -1,27 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_reply
#
# Translators:
# Randall Castro <rcastro@treintaycinco.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-19 16:49+0000\n"
"PO-Revision-Date: 2017-12-19 16:49+0000\n"
"Last-Translator: Randall Castro <rcastro@treintaycinco.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
"teams/76080/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: mail_reply
#. openerp-web
#: code:addons/mail_reply/static/src/xml/reply_button.xml:7
#, python-format
msgid "Reply"
msgstr "Responder"

22
mail_reply/i18n/mail_reply.pot

@ -1,22 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_reply
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \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_reply
#. openerp-web
#: code:addons/mail_reply/static/src/xml/reply_button.xml:7
#, python-format
msgid "Reply"
msgstr ""

BIN
mail_reply/images/mail_reply.jpg

Before

Width: 750  |  Height: 371  |  Size: 91 KiB

BIN
mail_reply/static/description/icon.png

Before

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

BIN
mail_reply/static/description/inbox.png

Before

Width: 761  |  Height: 400  |  Size: 67 KiB

31
mail_reply/static/description/index.html

@ -1,31 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Always show reply button</h2>
<h3 class="oe_slogan">Got a message out of a Record? Now you can reply to it too!</h3>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="inbox.png"/>
</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>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
</div>
</section>

51
mail_reply/static/src/js/mail_reply.js

@ -1,51 +0,0 @@
odoo.define("mail_reply.reply", function(require) {
"use strict";
var core = require("web.core");
var chat_manager = require("mail_base.base").chat_manager;
var ChatAction = core.action_registry.get("mail.chat.instant_messaging");
ChatAction.include({
_selectMessage: function(message_id) {
this._super.apply(this, arguments);
var message = chat_manager.get_message(message_id);
var subject = "";
if (message.record_name) {
subject = "Re: " + message.record_name;
} else if (message.subject) {
subject = "Re: " + message.subject;
}
this.extended_composer.set_subject(subject);
},
_onPostMessage: function(message) {
var self = this;
var options = this.selected_message ? {} : {channel_id: this.channel.id};
if (this.selected_message) {
message.subtype = "mail.mt_comment";
message.subtype_id = false;
message.message_type = "comment";
message.content_subtype = "html";
options.model = this.selected_message.model;
options.res_id = this.selected_message.res_id;
options.parent_id = this.selected_message.id;
}
chat_manager.post_message(message, options).then(function() {
if (self.selected_message) {
self._renderSnackbar(
"mail.chat.MessageSentSnackbar",
{record_name: self.selected_message.record_name},
5000
);
self._unselectMessage();
} else {
self.thread.scroll_to();
}
});
},
});
return chat_manager;
});

16
mail_reply/static/src/xml/reply_button.xml

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<t t-extend="mail.ChatThread.Message">
<t
t-jquery='i[class="fa fa-reply o_thread_icon o_thread_message_reply"]'
t-operation="replace"
>
<i
t-if="message.author_id != 'ODOOBOT' &amp;&amp; message.model != 'mail.channel' &amp;&amp; options.display_reply_icon"
class="fa fa-reply o_thread_icon o_thread_message_reply"
t-att-data-message-id="message.id"
title="Reply"
/>
</t>
</t>
</template>

17
mail_reply/templates.xml

@ -1,17 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<template
id="mail_reply_assets_backend"
name="mail_reply_assets_backend"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script
src="/mail_reply/static/src/js/mail_reply.js"
type="text/javascript"
/>
</xpath>
</template>
</data>
</openerp>

1
mail_reply/tests/__init__.py

@ -1 +0,0 @@
from . import test_default

40
mail_reply/tests/test_default.py

@ -1,40 +0,0 @@
import odoo.tests
@odoo.tests.common.at_install(False)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_mail_all(self):
# wait till page loaded and then click and wait again
code = """
setTimeout(function () {
var reply_button = $('.o_mail_info:not(:has(.o_document_link))').find(".fa.fa-reply.o_thread_icon.o_thread_message_reply");
if (reply_button.length === 0) {
console.log('error');
}
reply_button[0].click();
setTimeout(function () {
var send_button = $(".btn.btn-sm.btn-primary.o_composer_button_send.hidden-xs:visible");
if (send_button.length === 0) {
console.log('error');
}
$("textarea.o_input.o_composer_text_field")[1].value = 'test';
send_button.click();
setTimeout(function () {
if ($(".alert.o_mail_snackbar:visible").length === 0) {
console.log('error');
} else {
console.log('ok');
}
}, 1000);
}, 3000);
}, 1000);
"""
link = "/web#action=%s" % self.ref("mail.mail_channel_action_client_chat")
self.phantom_js(
link, code, "odoo.__DEBUG__.services['mail_reply.reply']", login="admin"
)

10
res_partner_company_messages/README.rst

@ -1,10 +0,0 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
Aggregate messages from company's contacts
==========================================
By default, odoo displays under partner form only its own messages. The module shows under company form both their own messages and the messages of any contacts attached to that company.
Tested on `Odoo 10.0 <https://github.com/odoo/odoo/commit/e8b0c1db69f04b0f8391d7ee4848ccf576018bf3>`_

1
res_partner_company_messages/__init__.py

@ -1 +0,0 @@
from . import models

15
res_partner_company_messages/__manifest__.py

@ -1,15 +0,0 @@
{
"name": "Aggregate messages from company's contacts",
"version": "11.0.1.0.0",
"author": "IT-Projects LLC, Ivan Yelizariev",
"license": "Other OSI approved licence", # MIT
"price": 70.00,
"currency": "EUR",
"category": "Discuss",
"support": "apps@itpp.dev",
"website": "https://twitter.com/yelizariev",
"images": ["images/child.png", "images/parent.png"],
"depends": ["mail"],
"data": ["views.xml"],
"installable": False,
}

26
res_partner_company_messages/i18n/de.po

@ -1,26 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_company_messages
#
# Translators:
# Dawid Runowski <dawrun@outlook.com>, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-05 23:11+0000\n"
"PO-Revision-Date: 2017-06-23 14:32+0000\n"
"Last-Translator: Dawid Runowski <dawrun@outlook.com>, 2019\n"
"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/"
"de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: res_partner_company_messages
#: model:ir.model,name:res_partner_company_messages.model_res_partner
msgid "Partner"
msgstr "Partner"

25
res_partner_company_messages/i18n/es.po

@ -1,25 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_company_messages
#
# Translators:
# Randall Castro <rcastro@treintaycinco.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-19 16:49+0000\n"
"PO-Revision-Date: 2017-12-19 16:49+0000\n"
"Last-Translator: Randall Castro <rcastro@treintaycinco.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
"teams/76080/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: res_partner_company_messages
#: model:ir.model,name:res_partner_company_messages.model_res_partner
msgid "Partner"
msgstr "Cliente"

20
res_partner_company_messages/i18n/res_partner_company_messages.pot

@ -1,20 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_company_messages
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \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: res_partner_company_messages
#: model:ir.model,name:res_partner_company_messages.model_res_partner
msgid "Partner"
msgstr ""

27
res_partner_company_messages/i18n/ru.po

@ -1,27 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_company_messages
#
# Translators:
# Lilya Salihova <liliya@it-projects.info>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-17 20:20+0000\n"
"PO-Revision-Date: 2017-07-17 20:20+0000\n"
"Last-Translator: Lilya Salihova <liliya@it-projects.info>, 2017\n"
"Language-Team: Russian (https://www.transifex.com/it-projects-llc/"
"teams/76080/ru/)\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
"%100>=11 && n%100<=14)? 2 : 3);\n"
#. module: res_partner_company_messages
#: model:ir.model,name:res_partner_company_messages.model_res_partner
msgid "Partner"
msgstr "Партнер"

BIN
res_partner_company_messages/images/child.png

Before

Width: 812  |  Height: 588  |  Size: 50 KiB

BIN
res_partner_company_messages/images/parent.png

Before

Width: 811  |  Height: 583  |  Size: 67 KiB

20
res_partner_company_messages/models.py

@ -1,20 +0,0 @@
from odoo import api, models
class Partner(models.Model):
_inherit = "res.partner"
@api.multi
def read(self, fields=None, load="_classic_read"):
res = super(Partner, self).read(fields=fields, load=load)
if fields and "message_ids" in fields:
for vals in res:
partner = self.browse(vals["id"])
if not partner.is_company:
continue
domain = [
("model", "=", "res.partner"),
("res_id", "in", [partner.id] + partner.child_ids.ids),
]
vals["message_ids"] = self.env["mail.message"].search(domain).ids
return res

BIN
res_partner_company_messages/static/description/icon.png

Before

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

5
res_partner_company_messages/views.xml

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
</data>
</openerp>

20
res_partner_mails_count/README.rst

@ -1,20 +0,0 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev
Smart buttons for mails count
=============================
This module adds Smart buttons with "Mails from" and "Mails to" count of mails in the partner form.
Usage
-----
You can see Smart buttons "Mails from" and "Mails to" in the contact form in the Messaging/Contacts menu. If you click on these buttons, you can see list of corresponded mails. Click on the "Send a message" link to send mail to the partner.
Further information
-------------------
Odoo Apps Store: https://apps.odoo.com/apps/modules/9.0/res_partner_mails_count/
Tested on `Odoo 9.0 <https://github.com/odoo/odoo/commit/b9f206953e3f877adf18643f154d1262842564ee>`_

1
res_partner_mails_count/__init__.py

@ -1 +0,0 @@
from . import models

22
res_partner_mails_count/__manifest__.py

@ -1,22 +0,0 @@
{
"name": """Partner mails count""",
"summary": """Displays amount of incoming and outgoing partner mails.""",
"category": "Discuss",
"images": ["images/1.png"],
"version": "11.0.1.0.0",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://itpp.dev",
"license": "Other OSI approved licence", # MIT
"price": 30.00,
"currency": "EUR",
"depends": [
"mail_all",
# 'web_tour_extra',
],
"external_dependencies": {"python": [], "bin": []},
"data": ["views/res_partner_mails_count.xml", "templates.xml"],
"demo": [],
"installable": False,
"auto_install": False,
}

127
res_partner_mails_count/i18n/de.po

@ -1,127 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_mails_count
#
# Translators:
# Dawid Runowski <dawrun@outlook.com>, 2019
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-05-05 23:11+0000\n"
"PO-Revision-Date: 2017-06-23 14:32+0000\n"
"Last-Translator: Dawid Runowski <dawrun@outlook.com>, 2019\n"
"Language-Team: German (https://www.transifex.com/it-projects-llc/teams/76080/"
"de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:31
#, python-format
msgid "Close Tutorial"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:25
#, python-format
msgid "Done"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:20
#, python-format
msgid "Here is new fields with mails counters. Press one of it."
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:15
#, python-format
msgid "Let's see how mails count work."
msgstr ""
#. module: res_partner_mails_count
#: model:ir.actions.client,name:res_partner_mails_count.action_mails
msgid "Mails"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:9
#, python-format
msgid "Mails count Tour"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:14
#, python-format
msgid "Mails count tutorial"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_from
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_from
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails from"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.actions.client,help:res_partner_mails_count.action_mails
msgid "Mails not found. Probably, they exist, but you don't have access."
msgstr ""
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_to
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_to
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails to"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:30
#, python-format
msgid ""
"Message are found. <br/>Enjoy your day! <br/> <br/><a href='https://www.it-"
"projects.info/apps' target='_blank'>IT-Projects LLC</a> team "
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:19
#, python-format
msgid "New fields"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.model,name:res_partner_mails_count.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Skip"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Start Tutorial"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.actions.act_url,name:res_partner_mails_count.res_partner_mails_count_tutorial
msgid "res_partner_mails_count Tutorial"
msgstr ""

127
res_partner_mails_count/i18n/es.po

@ -1,127 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_mails_count
#
# Translators:
# Randall Castro <rcastro@treintaycinco.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-19 16:49+0000\n"
"PO-Revision-Date: 2017-12-19 16:49+0000\n"
"Last-Translator: Randall Castro <rcastro@treintaycinco.com>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/it-projects-llc/"
"teams/76080/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:31
#, python-format
msgid "Close Tutorial"
msgstr "Cerrar Tutorial"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:25
#, python-format
msgid "Done"
msgstr "Realizado"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:20
#, python-format
msgid "Here is new fields with mails counters. Press one of it."
msgstr ""
"Aquí hay nuevos campos con contadores de correos. Presione uno de ellos."
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:15
#, python-format
msgid "Let's see how mails count work."
msgstr "Veamos cómo funcionan los correos electrónicos."
#. module: res_partner_mails_count
#: model:ir.actions.client,name:res_partner_mails_count.action_mails
msgid "Mails"
msgstr "Correos"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:9
#, python-format
msgid "Mails count Tour"
msgstr "Contador de correos Tour"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:14
#, python-format
msgid "Mails count tutorial"
msgstr "Tutorial de contador de correos"
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_from
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_from
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails from"
msgstr "Mensajes de"
#. module: res_partner_mails_count
#: model:ir.actions.client,help:res_partner_mails_count.action_mails
msgid "Mails not found. Probably, they exist, but you don't have access."
msgstr "Correos no encontrados. Probablemente existen, pero no tienes acceso."
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_to
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_to
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails to"
msgstr "Correos para"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:30
#, python-format
msgid ""
"Message are found. <br/>Enjoy your day! <br/> <br/><a href='https://www.it-"
"projects.info/apps' target='_blank'>IT-Projects LLC</a> team "
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:19
#, python-format
msgid "New fields"
msgstr "Nuevos campos"
#. module: res_partner_mails_count
#: model:ir.model,name:res_partner_mails_count.model_res_partner
msgid "Partner"
msgstr "Cliente"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Skip"
msgstr "Saltar"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Start Tutorial"
msgstr "Iniciar Tutorial"
#. module: res_partner_mails_count
#: model:ir.actions.act_url,name:res_partner_mails_count.res_partner_mails_count_tutorial
msgid "res_partner_mails_count Tutorial"
msgstr "Tutorial res_partner_mails_count"

119
res_partner_mails_count/i18n/res_partner_mails_count.pot

@ -1,119 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_mails_count
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \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: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:31
#, python-format
msgid "Close Tutorial"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:25
#, python-format
msgid "Done"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:20
#, python-format
msgid "Here is new fields with mails counters. Press one of it."
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:15
#, python-format
msgid "Let's see how mails count work."
msgstr ""
#. module: res_partner_mails_count
#: model:ir.actions.client,name:res_partner_mails_count.action_mails
msgid "Mails"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:9
#, python-format
msgid "Mails count Tour"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:14
#, python-format
msgid "Mails count tutorial"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_from
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_from
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails from"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.actions.client,help:res_partner_mails_count.action_mails
msgid "Mails not found. Probably, they exist, but you don't have access."
msgstr ""
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_to
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_to
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails to"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:30
#, python-format
msgid "Message are found. <br/>Enjoy your day! <br/> <br/><a href='https://www.it-projects.info/apps' target='_blank'>IT-Projects LLC</a> team "
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:19
#, python-format
msgid "New fields"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.model,name:res_partner_mails_count.model_res_partner
msgid "Partner"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Skip"
msgstr ""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Start Tutorial"
msgstr ""
#. module: res_partner_mails_count
#: model:ir.actions.act_url,name:res_partner_mails_count.res_partner_mails_count_tutorial
msgid "res_partner_mails_count Tutorial"
msgstr ""

130
res_partner_mails_count/i18n/ru.po

@ -1,130 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * res_partner_mails_count
#
# Translators:
# Lilya Salihova <liliya@it-projects.info>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-07-17 20:20+0000\n"
"PO-Revision-Date: 2017-07-17 20:20+0000\n"
"Last-Translator: Lilya Salihova <liliya@it-projects.info>, 2017\n"
"Language-Team: Russian (https://www.transifex.com/it-projects-llc/"
"teams/76080/ru/)\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
"%100>=11 && n%100<=14)? 2 : 3);\n"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:31
#, python-format
msgid "Close Tutorial"
msgstr "Закройте инструкцию"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:25
#, python-format
msgid "Done"
msgstr "Готово"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:20
#, python-format
msgid "Here is new fields with mails counters. Press one of it."
msgstr "Здесь новые поля с счетчиками писем. Нажмите на один из них."
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:15
#, python-format
msgid "Let's see how mails count work."
msgstr "Посмотрим как работает счетчик писем"
#. module: res_partner_mails_count
#: model:ir.actions.client,name:res_partner_mails_count.action_mails
msgid "Mails"
msgstr "Письма"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:9
#, python-format
msgid "Mails count Tour"
msgstr "Руководство по модулю \"Mails count\""
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:14
#, python-format
msgid "Mails count tutorial"
msgstr "Инструкция по счетчику писем"
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_from
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_from
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails from"
msgstr "Входящие"
#. module: res_partner_mails_count
#: model:ir.actions.client,help:res_partner_mails_count.action_mails
msgid "Mails not found. Probably, they exist, but you don't have access."
msgstr "Письма не найдены. Возможно, они есть, но у вас нет к ним доступа."
#. module: res_partner_mails_count
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_partner_mails_to
#: model:ir.model.fields,field_description:res_partner_mails_count.field_res_users_mails_to
#: model:ir.ui.view,arch_db:res_partner_mails_count.view_res_partner_mails_count_info_form
msgid "Mails to"
msgstr "Исходящие"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:30
#, python-format
msgid ""
"Message are found. <br/>Enjoy your day! <br/> <br/><a href='https://www.it-"
"projects.info/apps' target='_blank'>IT-Projects LLC</a> team "
msgstr ""
"Письма найдены. <br/> Хорошего дня! <br/><br/><a href='https://www.it-"
"projects.info/apps' target='_blank'>IT-Projects LLC</a> team "
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:19
#, python-format
msgid "New fields"
msgstr "Новые поля"
#. module: res_partner_mails_count
#: model:ir.model,name:res_partner_mails_count.model_res_partner
msgid "Partner"
msgstr "Партнер"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Skip"
msgstr "Пропустить"
#. module: res_partner_mails_count
#. openerp-web
#: code:addons/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js:16
#, python-format
msgid "Start Tutorial"
msgstr "Начать обучение"
#. module: res_partner_mails_count
#: model:ir.actions.act_url,name:res_partner_mails_count.res_partner_mails_count_tutorial
msgid "res_partner_mails_count Tutorial"
msgstr "res_partner_mails_count Руководство"

BIN
res_partner_mails_count/images/1.png

Before

Width: 1128  |  Height: 528  |  Size: 92 KiB

23
res_partner_mails_count/models.py

@ -1,23 +0,0 @@
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
mails_to = fields.Integer(compute="_compute_mails_to")
mails_from = fields.Integer(compute="_compute_mails_from")
@api.multi
def _compute_mails_to(self):
for r in self:
r.mails_to = (
self.env["mail.message"]
.sudo()
.search_count([("partner_ids", "in", r.id)])
)
@api.multi
def _compute_mails_from(self):
for r in self:
r.mails_from = (
self.env["mail.message"].sudo().search_count([("author_id", "=", r.id)])
)

BIN
res_partner_mails_count/static/description/1.png

Before

Width: 1128  |  Height: 528  |  Size: 66 KiB

BIN
res_partner_mails_count/static/description/2.png

Before

Width: 1128  |  Height: 528  |  Size: 63 KiB

BIN
res_partner_mails_count/static/description/3.png

Before

Width: 1128  |  Height: 528  |  Size: 46 KiB

BIN
res_partner_mails_count/static/description/icon.png

Before

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

36
res_partner_mails_count/static/description/index.html

@ -1,36 +0,0 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Smart buttons for mails count</h2>
<h3 class="oe_slogan">Display amount of messages from/to customer</h3>
<p>
Open partner (customer) form and look up how many messages he got and sent:
<img class="oe_picture oe_screenshot" src="1.png"/>
</p>
<p>
If you click any of this buttons:
<img class="oe_picture oe_screenshot" src="2.png"/>
</p>
<p>
You will see those mails:
<img class="oe_picture oe_screenshot" src="3.png"/>
</p>
</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>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
</div>
</section>

38
res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js

@ -1,38 +0,0 @@
odoo.define("res_partner_mails_count.res_partner_mails_count_tour", function(require) {
"use strict";
var Core = require("web.core");
var Tour = require("web.Tour");
var _t = Core._t;
Tour.register({
id: "mails_count_tour",
name: _t("Mails count Tour"),
mode: "test",
path:
"/web?res_partner_mails_count=tutorial#id=3&view_type=form&model=res.partner",
steps: [
{
title: _t("Mails count tutorial"),
content: _t("Let's see how mails count work."),
popover: {next: _t("Start Tutorial"), end: _t("Skip")},
},
{
title: _t("New fields"),
content: _t("Here is new fields with mails counters. Press one of it."),
element: ".mails_to",
waitFor: ".mails_to:visible",
},
{
title: _t("Done"),
placement: "top",
waitNot: ".mails_to:visible",
waitFor: ".o_mail_thread",
element: ".o_mail_thread",
content: _t(
"Message are found. <br/>Enjoy your day! <br/> <br/><a href='https://www.it-projects.info/apps' target='_blank'>IT-Projects LLC</a> team "
),
popover: {next: _t("Close Tutorial")},
},
],
});
});

62
res_partner_mails_count/templates.xml

@ -1,62 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
<template id="res_partner_mails_count_assets_backend"
inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script src="/res_partner_mails_count/static/src/js/res_partner_mails_count_tour.js"
type="text/javascript"></script>
</xpath>
</template>
-->
<record id="view_res_partner_mails_count_info_form" model="ir.ui.view">
<field name="name">res.partner.mails.count</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="priority" eval="50" />
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button
class="oe_stat_button mails_to"
type="action"
name="%(action_mails)d"
context="{'search_default_partner_ids': [active_id], 'default_model': 'res.partner', 'default_res_id': active_id}"
icon="fa-envelope"
>
<field string="Mails to" name="mails_to" widget="statinfo" />
</button>
<button
class="oe_stat_button mails_from"
type="action"
name="%(action_mails)d"
context="{'search_default_author_id': active_id, 'default_model': 'res.partner', 'default_res_id': active_id}"
icon="fa-envelope-o"
>
<field
string="Mails from"
name="mails_from"
widget="statinfo"
/>
</button>
</div>
</field>
</record>
<record id="res_partner_mails_count_tutorial" model="ir.actions.act_url">
<field name="name">res_partner_mails_count Tutorial</field>
<field
name="url"
eval="'/web?res_partner_mails_count=tutorial#id='+str(ref('base.partner_root'))+'&amp;view_type=form&amp;model=res.partner&amp;/#tutorial_extra.mails_count_tour=true'"
/>
<field name="target">self</field>
</record>
</data>
<data noupdate="1">
<record id="base.open_menu" model="ir.actions.todo">
<field name="action_id" ref="res_partner_mails_count_tutorial" />
<field name="state">open</field>
<field name="sequence">500</field>
<field name="type">automatic</field>
</record>
</data>
</openerp>

3
res_partner_mails_count/tests/__init__.py

@ -1,3 +0,0 @@
from . import test_mail
# from . import test_phantom

62
res_partner_mails_count/tests/test_mail.py

@ -1,62 +0,0 @@
from odoo.tests.common import TransactionCase
class TestMessageCount(TransactionCase):
post_install = True
def test_count(self):
new_partner1 = (
self.env["res.partner"]
.sudo()
.create(
{
"name": "rpmc Test Partner one",
"email": "tt@tt",
"notify_email": "always",
}
)
)
new_partner2 = (
self.env["res.partner"]
.sudo()
.create(
{
"name": "rpmc Test Partner two",
"email": "rr@rr",
"notify_email": "always",
}
)
)
self.assertEqual(
new_partner1.mails_to, 0, "rpmc: new partner have mails_to != 0"
)
mail_compose = self.env["mail.compose.message"]
compose = mail_compose.with_context(
{"default_composition_mode": "comment"}
).create(
{
"subject": "test subj",
"body": "test body",
"partner_ids": [(4, new_partner2.id)],
"email_from": "tt@tt",
"author_id": new_partner1.id,
}
)
compose.send_mail()
self.assertEqual(new_partner1.mails_to, 0)
self.assertEqual(
new_partner1.mails_from, 1, "rpmc: one message but mails_from != 1"
)
self.assertEqual(
new_partner2.mails_to, 1, "rpmc: one message but mails_to != 1"
)
self.assertEqual(new_partner2.mails_from, 0)
compose.send_mail()
self.assertEqual(new_partner1.mails_to, 0)
self.assertEqual(
new_partner1.mails_from, 2, "rpmc: one message but mails_from != 2"
)
self.assertEqual(
new_partner2.mails_to, 2, "rpmc: one message but mails_to != 2"
)
self.assertEqual(new_partner2.mails_from, 0)

30
res_partner_mails_count/tests/test_phantom.py

@ -1,30 +0,0 @@
import odoo.tests
@odoo.tests.common.at_install(False)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_res_partner_mails_to_count(self):
# self.phantom_js('/', "openerp.Tour.run('mails_count_tour', 'test')", "openerp.Tour.tours.mails_count_tour", login="admin")
self.phantom_js(
"/",
"odoo.__DEBUG__.services['web.Tour'].run('mails_count_tour', 'test')",
"odoo.__DEBUG__.services['web.Tour'].tours.mails_count_tour",
login="admin",
)
def test_02_res_partner_mails_from_count(self):
# wait till page loaded and then click and wait again
code = """
setTimeout(function () {
$(".mails_from").click();
setTimeout(function () {console.log('ok');}, 3000);
}, 3000);
"""
link = "/web#id=3&view_type=form&model=res.partner"
self.phantom_js(
link,
code,
"odoo.__DEBUG__.services['web.Tour'].tours.mails_count_tour",
login="admin",
)

18
res_partner_mails_count/views/res_partner_mails_count.xml

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<openerp>
<data>
<record id="action_mails" model="ir.actions.client">
<field name="name">Mails</field>
<field name="tag">mail.chat.instant_messaging</field>
<field name="res_model">mail.message</field>
<field name="context">{
'active_id': 'channel_all'
}</field>
<field name="help" type="html">
<p>
Mails not found. Probably, they exist, but you don't have access.
</p>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save