From ec739b41575a26e510c92a55fc64cdace4368040 Mon Sep 17 00:00:00 2001 From: ralwafaie Date: Wed, 15 Jun 2016 13:51:50 +0200 Subject: [PATCH 1/4] mail_print module --- mail_print/README.rst | 45 ++++++++++++++++++ mail_print/__init__.py | 3 ++ mail_print/__openerp__.py | 22 +++++++++ mail_print/i18n/de.po | 47 +++++++++++++++++++ mail_print/report.xml | 15 ++++++ mail_print/views/mail_message_report.xml | 60 ++++++++++++++++++++++++ 6 files changed, 192 insertions(+) create mode 100644 mail_print/README.rst create mode 100644 mail_print/__init__.py create mode 100644 mail_print/__openerp__.py create mode 100644 mail_print/i18n/de.po create mode 100644 mail_print/report.xml create mode 100644 mail_print/views/mail_message_report.xml diff --git a/mail_print/README.rst b/mail_print/README.rst new file mode 100644 index 00000000..0c0ed2d6 --- /dev/null +++ b/mail_print/README.rst @@ -0,0 +1,45 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +========== +Mail Print +========== + +This module makes pdf reports from the Emails, so the user will be able to print them. + +Usage +===== + +* go to ... + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Rami Alwafaie + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/mail_print/__init__.py b/mail_print/__init__.py new file mode 100644 index 00000000..ba9bebe8 --- /dev/null +++ b/mail_print/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2016 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/mail_print/__openerp__.py b/mail_print/__openerp__.py new file mode 100644 index 00000000..7d43e890 --- /dev/null +++ b/mail_print/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © initOS GmbH 2016 +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': "Print Emails", + 'summary': """ + PDF Reports to print the emails + """, + 'author': "initOS GmbH, Odoo Community Association (OCA)", + 'website': "http://www.initos.com", + 'version': '8.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'report', + 'mail', + ], + 'data': [ + 'report.xml', + 'views/mail_message_report.xml', + ], +} diff --git a/mail_print/i18n/de.po b/mail_print/i18n/de.po new file mode 100644 index 00000000..f7be5909 --- /dev/null +++ b/mail_print/i18n/de.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mail_print +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-10 13:16+0000\n" +"PO-Revision-Date: 2016-06-10 15:18+0100\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.5.4\n" + +#. module: mail_print +#: view:website:mail_print.mail_message +msgid "Attachments" +msgstr "Anhänge" + +#. module: mail_print +#: view:website:mail_print.mail_message +msgid "Date:" +msgstr "Datum:" + +#. module: mail_print +#: model:ir.actions.report.xml,name:mail_print.mail_message_pdf +msgid "Email" +msgstr "Email" + +#. module: mail_print +#: view:website:mail_print.mail_message +msgid "From:" +msgstr "Von:" + +#. module: mail_print +#: view:website:mail_print.mail_message +msgid "Subject:" +msgstr "Betreff:" + +#. module: mail_print +#: view:website:mail_print.mail_message +msgid "To:" +msgstr "An:" diff --git a/mail_print/report.xml b/mail_print/report.xml new file mode 100644 index 00000000..cebd841d --- /dev/null +++ b/mail_print/report.xml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/mail_print/views/mail_message_report.xml b/mail_print/views/mail_message_report.xml new file mode 100644 index 00000000..e4fe6a0c --- /dev/null +++ b/mail_print/views/mail_message_report.xml @@ -0,0 +1,60 @@ + + + + + + + + From 747809f7b03f90ef46b61e4ad103739195763f50 Mon Sep 17 00:00:00 2001 From: ralwafaie Date: Thu, 16 Jun 2016 08:09:21 +0200 Subject: [PATCH 2/4] #69 edit README --- mail_print/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_print/README.rst b/mail_print/README.rst index 0c0ed2d6..a41933a6 100644 --- a/mail_print/README.rst +++ b/mail_print/README.rst @@ -10,7 +10,7 @@ This module makes pdf reports from the Emails, so the user will be able to print Usage ===== -* go to ... +* go to Technical -> Email -> Messages -> select the Email -> Print Bug Tracker From 54c2fc15007702106d1a5d26cfbf9fc5804821c3 Mon Sep 17 00:00:00 2001 From: Mathias Francke Date: Wed, 17 Aug 2016 15:34:00 +0200 Subject: [PATCH 3/4] [IMP] Added button to print emials to mail message view --- mail_print/README.rst | 1 + mail_print/__openerp__.py | 5 +++++ mail_print/static/src/css/mail.css | 4 ++++ mail_print/static/src/js/mail.js | 17 +++++++++++++++++ mail_print/static/src/xml/mail.xml | 8 ++++++++ mail_print/views/templates.xml | 12 ++++++++++++ 6 files changed, 47 insertions(+) create mode 100644 mail_print/static/src/css/mail.css create mode 100644 mail_print/static/src/js/mail.js create mode 100644 mail_print/static/src/xml/mail.xml create mode 100644 mail_print/views/templates.xml diff --git a/mail_print/README.rst b/mail_print/README.rst index a41933a6..cc27d4f0 100644 --- a/mail_print/README.rst +++ b/mail_print/README.rst @@ -28,6 +28,7 @@ Contributors ------------ * Rami Alwafaie +* Mathias Francke Maintainer ---------- diff --git a/mail_print/__openerp__.py b/mail_print/__openerp__.py index 7d43e890..0438c029 100644 --- a/mail_print/__openerp__.py +++ b/mail_print/__openerp__.py @@ -14,9 +14,14 @@ 'depends': [ 'report', 'mail', + 'web', ], 'data': [ 'report.xml', 'views/mail_message_report.xml', + 'views/templates.xml', ], + 'qweb': [ + 'static/src/xml/mail.xml', + ], } diff --git a/mail_print/static/src/css/mail.css b/mail_print/static/src/css/mail.css new file mode 100644 index 00000000..2bc66b5a --- /dev/null +++ b/mail_print/static/src/css/mail.css @@ -0,0 +1,4 @@ +.openerp .oe_mail .oe_msg .oe_msg_icons .oe_mail_print:hover a{ + color: #1FFF10; + text-shadow: 0px 1px #149E0B,0px -1px #149E0B, -1px 0px #149E0B, 1px 0px #149E0B, 0px 3px 3px rgba(0,0,0,0.1); +} diff --git a/mail_print/static/src/js/mail.js b/mail_print/static/src/js/mail.js new file mode 100644 index 00000000..01bad65e --- /dev/null +++ b/mail_print/static/src/js/mail.js @@ -0,0 +1,17 @@ +openerp.mail_print = function(instance) { + instance.mail.ThreadMessage.include({ + + bind_events: function () { + this._super(); + this.$('.oe_mail_print').on('click', this.on_mail_print); + }, + + on_mail_print: function (event) { + event.preventDefault(); + this.session.get_file({ + 'url': '/report/download', + 'data': {'data': '["/report/pdf/mail_print.mail_message/' + this.id + '","qweb-pdf"]'} + }); + } + }); +}; \ No newline at end of file diff --git a/mail_print/static/src/xml/mail.xml b/mail_print/static/src/xml/mail.xml new file mode 100644 index 00000000..3a5fa602 --- /dev/null +++ b/mail_print/static/src/xml/mail.xml @@ -0,0 +1,8 @@ + + + + + < + + + diff --git a/mail_print/views/templates.xml b/mail_print/views/templates.xml new file mode 100644 index 00000000..a934807a --- /dev/null +++ b/mail_print/views/templates.xml @@ -0,0 +1,12 @@ + + + + + + + From b2c70ba1e643809fb98b4da32f4317cbb91da9c1 Mon Sep 17 00:00:00 2001 From: ralwafaie Date: Thu, 18 Aug 2016 10:22:31 +0200 Subject: [PATCH 4/4] #69 fix qweb template - add the new feature to read me --- mail_print/README.rst | 1 + mail_print/views/mail_message_report.xml | 32 +++++++++++------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/mail_print/README.rst b/mail_print/README.rst index cc27d4f0..5a4d015d 100644 --- a/mail_print/README.rst +++ b/mail_print/README.rst @@ -11,6 +11,7 @@ Usage ===== * go to Technical -> Email -> Messages -> select the Email -> Print +* Emails can be also downloaded directly from The Messaging dashboard Bug Tracker diff --git a/mail_print/views/mail_message_report.xml b/mail_print/views/mail_message_report.xml index e4fe6a0c..5094080c 100644 --- a/mail_print/views/mail_message_report.xml +++ b/mail_print/views/mail_message_report.xml @@ -8,45 +8,41 @@
- +
- - + + - - + + - - + + - - + +
From:From:
To: To:
Subject:Subject:
Date:Date:
- +
- +
- + - - + +
AttachmentsAttachments
BytesBytes