Skip to content

Commit

Permalink
[2834][ADD] mail_quoted_reply
Browse files Browse the repository at this point in the history
  • Loading branch information
rinaldifirdaus committed Sep 20, 2023
1 parent e0c2513 commit ceec64b
Show file tree
Hide file tree
Showing 21 changed files with 929 additions and 0 deletions.
84 changes: 84 additions & 0 deletions mail_quoted_reply/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
==================
Mail Message Reply
==================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9f4201e9f5d8bdfb5dff9dc2f2d8c2c5d76ae42355e6ed17ef6eadb3843bf444
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/15.0/mail_quoted_reply
:alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_quoted_reply
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/social&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This addon allow to reply on messages from odoo directly.
It is useful when replying to a message from a customer.

**Table of contents**

.. contents::
:local:

Usage
=====

On the messages from threads, a reply button is shown.
Once it has been pressed, a composer with the reply is shown.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_quoted_reply%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Creu Blanca

Contributors
~~~~~~~~~~~~

* Enric Tobella
* Lois Rilo <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/social <https://github.com/OCA/social/tree/15.0/mail_quoted_reply>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mail_quoted_reply/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions mail_quoted_reply/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2021 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Mail Message Reply",
"summary": """
Make a reply using a message""",
"version": "15.0.1.0.1",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
"depends": ["mail"],
"data": [],
"assets": {
"web.assets_qweb": [
"/mail_quoted_reply/static/src/xml/mail_message_reply.xml",
],
"web.assets_backend": [
"/mail_quoted_reply/static/src/models/mail_message_reply.esm.js",
"/mail_quoted_reply/static/src/components/mail_message_reply.esm.js",
],
},
}
75 changes: 75 additions & 0 deletions mail_quoted_reply/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_quoted_reply
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-07-04 15:05+0000\n"
"Last-Translator: jabelchi <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\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"
"X-Generator: Weblate 4.3.2\n"

#. module: mail_quoted_reply
#: model:ir.model,name:mail_quoted_reply.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Assistent de redacció d'emails"

#. module: mail_quoted_reply
#: model:ir.model,name:mail_quoted_reply.model_mail_message
msgid "Message"
msgstr "Missatge"

#. module: mail_quoted_reply
#. openerp-web
#: code:addons/mail_quoted_reply/static/src/xml/mail_message_reply.xml:0
#, python-format
msgid "Reply"
msgstr "Respon"

#~ msgid ""
#~ "\n"
#~ " <div>\n"
#~ " </div>\n"
#~ " <br/>\n"
#~ " <blockquote style=\"padding-right:0px; padding-left:5px; "
#~ "border-left-color: #000; margin-left:5px; margin-right:0px;border-left-"
#~ "width: 2px; border-left-style:solid\">\n"
#~ " From: ${object.email_from}<br/>\n"
#~ " Date: ${object.date}<br/>\n"
#~ " Subject: ${object.subject}<br/>\n"
#~ " ${object.body | safe}\n"
#~ " </blockquote>\n"
#~ " "
#~ msgstr ""
#~ "\n"
#~ " <div>\n"
#~ " </div>\n"
#~ " <br/>\n"
#~ " <blockquote style=\"padding-right:0px; padding-left:5px; "
#~ "border-left-color: #000; margin-left:5px; margin-right:0px;border-left-"
#~ "width: 2px; border-left-style:solid\">\n"
#~ " From: ${object.email_from}<br/>\n"
#~ " Date: ${object.date}<br/>\n"
#~ " Subject: ${object.subject}<br/>\n"
#~ " ${object.body | safe}\n"
#~ " </blockquote>\n"
#~ " "

#~ msgid "Display Name"
#~ msgstr "Nom a mostrar"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Darrera modificació el"

#~ msgid "Re: ${object.subject}"
#~ msgstr "Re: ${object.subject}"
75 changes: 75 additions & 0 deletions mail_quoted_reply/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_quoted_reply
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-07-04 15:05+0000\n"
"Last-Translator: jabelchi <[email protected]>\n"
"Language-Team: none\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"
"X-Generator: Weblate 4.3.2\n"

#. module: mail_quoted_reply
#: model:ir.model,name:mail_quoted_reply.model_mail_compose_message
msgid "Email composition wizard"
msgstr "Asistente composición Correo Electrónico"

#. module: mail_quoted_reply
#: model:ir.model,name:mail_quoted_reply.model_mail_message
msgid "Message"
msgstr "Mensaje"

#. module: mail_quoted_reply
#. openerp-web
#: code:addons/mail_quoted_reply/static/src/xml/mail_message_reply.xml:0
#, python-format
msgid "Reply"
msgstr "Responder"

#~ msgid ""
#~ "\n"
#~ " <div>\n"
#~ " </div>\n"
#~ " <br/>\n"
#~ " <blockquote style=\"padding-right:0px; padding-left:5px; "
#~ "border-left-color: #000; margin-left:5px; margin-right:0px;border-left-"
#~ "width: 2px; border-left-style:solid\">\n"
#~ " From: ${object.email_from}<br/>\n"
#~ " Date: ${object.date}<br/>\n"
#~ " Subject: ${object.subject}<br/>\n"
#~ " ${object.body | safe}\n"
#~ " </blockquote>\n"
#~ " "
#~ msgstr ""
#~ "\n"
#~ " <div>\n"
#~ " </div>\n"
#~ " <br/>\n"
#~ " <blockquote style=\"padding-right:0px; padding-left:5px; "
#~ "border-left-color: #000; margin-left:5px; margin-right:0px;border-left-"
#~ "width: 2px; border-left-style:solid\">\n"
#~ " From: ${object.email_from}<br/>\n"
#~ " Date: ${object.date}<br/>\n"
#~ " Subject: ${object.subject}<br/>\n"
#~ " ${object.body | safe}\n"
#~ " </blockquote>\n"
#~ " "

#~ msgid "Display Name"
#~ msgstr "Nombre mostrado"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"

#~ msgid "Re: ${object.subject}"
#~ msgstr "Re: ${object.subject}"
31 changes: 31 additions & 0 deletions mail_quoted_reply/i18n/mail_quoted_reply.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_quoted_reply
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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_quoted_reply
#: model:ir.model,name:mail_quoted_reply.model_mail_compose_message
msgid "Email composition wizard"
msgstr ""

#. module: mail_quoted_reply
#: model:ir.model,name:mail_quoted_reply.model_mail_message
msgid "Message"
msgstr ""

#. module: mail_quoted_reply
#. openerp-web
#: code:addons/mail_quoted_reply/static/src/xml/mail_message_reply.xml:0
#, python-format
msgid "Reply"
msgstr ""
2 changes: 2 additions & 0 deletions mail_quoted_reply/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import mail_message
from . import mail_compose_message
15 changes: 15 additions & 0 deletions mail_quoted_reply/models/mail_compose_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from markupsafe import Markup

from odoo import api, models


class MailComposeMessage(models.TransientModel):
_inherit = "mail.compose.message"

@api.onchange("template_id")
def _onchange_template_id_wrapper(self):
super()._onchange_template_id_wrapper()
context = self._context
if "is_quoted_reply" in context.keys() and context["is_quoted_reply"]:
self.body += Markup(context["quote_body"])
return
48 changes: 48 additions & 0 deletions mail_quoted_reply/models/mail_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2021 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class MailMessage(models.Model):

_inherit = "mail.message"

def _prep_quoted_reply_body(self):
return """
<div>
<br/>
<br/>
</div>
<br/>
<blockquote style="padding-right:0px; padding-left:5px; border-left-color: #000;
margin-left:5px; margin-right:0px;border-left-width: 2px; border-left-style:solid">
From: {email_from}<br/>
Date: {date}<br/>
Subject: {subject}<br/>
{body}
</blockquote>
""".format(
email_from=self.email_from,
date=self.date,
subject=self.subject,
body=self.body,
)

def reply_message(self):
action = self.env["ir.actions.actions"]._for_xml_id(
"mail.action_email_compose_message_wizard"
)
action["context"] = {
"default_model": self.model,
"default_res_id": self.res_id,
"default_composition_mode": "comment",
"quote_body": self._prep_quoted_reply_body(),
"default_is_log": False,
"is_log": False,
"is_quoted_reply": True,
"default_notify": True,
"force_email": True,
"default_partner_ids": self.partner_ids.ids,
}
return action
2 changes: 2 additions & 0 deletions mail_quoted_reply/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Enric Tobella
* Lois Rilo <[email protected]>
2 changes: 2 additions & 0 deletions mail_quoted_reply/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This addon allow to reply on messages from odoo directly.
It is useful when replying to a message from a customer.
2 changes: 2 additions & 0 deletions mail_quoted_reply/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On the messages from threads, a reply button is shown.
Once it has been pressed, a composer with the reply is shown.
Binary file added mail_quoted_reply/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ceec64b

Please sign in to comment.