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 @@ + + + + + + +