diff --git a/email_template_qweb/README.rst b/email_template_qweb/README.rst new file mode 100644 index 000000000..f53852b06 --- /dev/null +++ b/email_template_qweb/README.rst @@ -0,0 +1,104 @@ +======================== +QWeb for email templates +======================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/email_template_qweb + :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-email_template_qweb + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/social&target_branch=15.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module was written to allow you to write email templates in `QWeb view` instead +of QWeb. The advantage here is that with QWeb View, you can make use of +inheritance and the ``call`` statement, which allows you to reuse designs and +snippets in multiple templates, making your development process simpler. +Furthermore, QWeb views are easier to edit with the integrated ACE editor. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +#. Select `QWeb View` in the field `Body templating engine` +#. Select a `QWeb View` to be used to render the body field +#. Apart from `QWeb View` standard variables, you also have access to ``object`` and ``email_template``, which are browse records of the current object and the email template in use, respectively. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Therp BV + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn +* Dave Lasley +* Carlos Lopez Mite +* `Tecnativa `_: + + * Ernesto Tejeda + +* Thomas Fossoul (thomas@niboo.com) +* Phuc Tran Thanh +* Foram Shah +* `Trobz `_: + * Dzung Tran + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Camptocamp + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/email_template_qweb/__init__.py b/email_template_qweb/__init__.py new file mode 100644 index 000000000..8d7f2c4ba --- /dev/null +++ b/email_template_qweb/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import models diff --git a/email_template_qweb/__manifest__.py b/email_template_qweb/__manifest__.py new file mode 100644 index 000000000..08571d792 --- /dev/null +++ b/email_template_qweb/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "QWeb for email templates", + "version": "15.0.1.0.0", + "author": "Therp BV, Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Marketing", + "summary": "Use the QWeb templating mechanism for emails", + "website": "https://github.com/OCA/social", + "depends": ["mail"], + "demo": ["demo/ir_ui_view.xml", "demo/mail_template.xml"], + "data": ["views/mail_template.xml"], + "installable": True, +} diff --git a/email_template_qweb/demo/ir_ui_view.xml b/email_template_qweb/demo/ir_ui_view.xml new file mode 100644 index 000000000..e58921452 --- /dev/null +++ b/email_template_qweb/demo/ir_ui_view.xml @@ -0,0 +1,42 @@ + + + + + diff --git a/email_template_qweb/demo/mail_template.xml b/email_template_qweb/demo/mail_template.xml new file mode 100644 index 000000000..254b9d5f9 --- /dev/null +++ b/email_template_qweb/demo/mail_template.xml @@ -0,0 +1,10 @@ + + + + QWeb demo + qweb_view + + + QWeb demo email + + diff --git a/email_template_qweb/i18n/de.po b/email_template_qweb/i18n/de.po new file mode 100644 index 000000000..d3cca7a67 --- /dev/null +++ b/email_template_qweb/i18n/de.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-10 11:20+0000\n" +"PO-Revision-Date: 2017-02-10 11:20+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Nachrichtenansicht" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Nachrichtenvorlagen Generator" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Sehr geehrter" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "E-Mail Vorlagen" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "QWeb Demo-E-Mail" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Dies ist eine E-Mail-Vorlage aus qweb." + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Zeige Stilarten" diff --git a/email_template_qweb/i18n/email_template_qweb.pot b/email_template_qweb/i18n/email_template_qweb.pot new file mode 100644 index 000000000..b19d65d50 --- /dev/null +++ b/email_template_qweb/i18n/email_template_qweb.pot @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +msgid "Body View" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__display_name +msgid "Display Name" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__id +msgid "ID" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template____last_update +msgid "Last Modified on" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use translation.\n" +" Note that it will read `arch_db` or `arch_fs` if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "" diff --git a/email_template_qweb/i18n/es.po b/email_template_qweb/i18n/es.po new file mode 100644 index 000000000..947478c06 --- /dev/null +++ b/email_template_qweb/i18n/es.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-10 11:20+0000\n" +"PO-Revision-Date: 2017-02-10 11:20+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Vista del cuerpo" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Motor de plantilla para el cuerpo del mensaje" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Estimado" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Plantillas de correo electrónico" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "Correo electrónico demo en QWeb" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Esto es una plantilla de correo electrónico usando QWeb" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Arquitectura de la vista" diff --git a/email_template_qweb/i18n/es_MX.po b/email_template_qweb/i18n/es_MX.po new file mode 100644 index 000000000..9e7d9605e --- /dev/null +++ b/email_template_qweb/i18n/es_MX.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-29 14:24+0000\n" +"PO-Revision-Date: 2016-11-29 14:24+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Vista del cuerpo" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Querido" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Plantillas de Correo Electrónico" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "Correo QWeb de demo" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Esta es una plantilla de correo utilizando qweb" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "" diff --git a/email_template_qweb/i18n/fr.po b/email_template_qweb/i18n/fr.po new file mode 100644 index 000000000..244488f7d --- /dev/null +++ b/email_template_qweb/i18n/fr.po @@ -0,0 +1,86 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-22 09:45+0000\n" +"PO-Revision-Date: 2021-03-22 16:46+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Vue du corps" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Moteur de modèle de corps" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Cher" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Modèles de courriel" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "Courriel QWeb de démonstration" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +#, fuzzy +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" +"Ce champ doit être utilisé lors de l'accès à l'arche de vue. Il utilisera la " +"traduction.\n" +" Notez qu'il lira `arch_db` ou` arch_fs` s'il " +"est en mode dev-xml." + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Ceci est un modèle de courriel utilisant qweb." + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Architecture de la vue" diff --git a/email_template_qweb/i18n/fr_FR.po b/email_template_qweb/i18n/fr_FR.po new file mode 100644 index 000000000..96153181a --- /dev/null +++ b/email_template_qweb/i18n/fr_FR.po @@ -0,0 +1,88 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-11 18:46+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\n" +"Language: fr_FR\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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +msgid "Body View" +msgstr "Vue du corps" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Moteur de modèle de corps" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Cher" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__display_name +msgid "Display Name" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Modèles de courriel" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__id +msgid "ID" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template____last_update +msgid "Last Modified on" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "Courriel QWeb de démonstration" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use translation.\n" +" Note that it will read `arch_db` or `arch_fs` if in dev-xml mode." +msgstr "" +"Ce champ doit être utilisé lors de l'accès à la vue arch. Il utilisera la " +"traduction.\n" +" Notez qu'il lira `arch_db` ou` arch_fs` s'il " +"est en mode dev-xml." + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Ceci est un modèle de courriel utilisant qweb." + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Architecture de la vue" diff --git a/email_template_qweb/i18n/hr.po b/email_template_qweb/i18n/hr.po new file mode 100644 index 000000000..aa4cafd90 --- /dev/null +++ b/email_template_qweb/i18n/hr.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-10 11:20+0000\n" +"PO-Revision-Date: 2017-02-10 11:20+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Pregled tijela" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Mehanizam predložaka poruke" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Dragi" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Predlošci mailova" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "QWeb demo email" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Ovo je predložak emaila korištenjem qweb-a." + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Pregled arhitekture" diff --git a/email_template_qweb/i18n/it.po b/email_template_qweb/i18n/it.po new file mode 100644 index 000000000..6e5086d6b --- /dev/null +++ b/email_template_qweb/i18n/it.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# OCA Transbot , 2016 +# Marius Marolla , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-17 01:02+0000\n" +"PO-Revision-Date: 2017-05-17 01:02+0000\n" +"Last-Translator: Marius Marolla , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Visualizzazione Messaggio" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Motore dei Modelli di Messaggio" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Gentile" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Modelli Email" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "Demo Email QWeb" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Questo è un modello di email basato su QWeb" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Visualizza Architettura" diff --git a/email_template_qweb/i18n/nl_NL.po b/email_template_qweb/i18n/nl_NL.po new file mode 100644 index 000000000..1cac275e9 --- /dev/null +++ b/email_template_qweb/i18n/nl_NL.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-20 08:36+0000\n" +"PO-Revision-Date: 2017-05-20 08:36+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +msgid "Body View" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Geachte" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "E-mailsjablonen" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "QWeb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "QWeb demo email" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "" diff --git a/email_template_qweb/i18n/pt_BR.po b/email_template_qweb/i18n/pt_BR.po new file mode 100644 index 000000000..97cbe8c57 --- /dev/null +++ b/email_template_qweb/i18n/pt_BR.po @@ -0,0 +1,82 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# falexandresilva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-22 00:50+0000\n" +"PO-Revision-Date: 2019-09-17 14:24+0000\n" +"Last-Translator: Rodrigo Macedo \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\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 3.8\n" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +#, fuzzy +msgid "Body View" +msgstr "Visualizar Corpo" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "Motor de modelagem do corpo" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "Caro" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Modelos de E-mail" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "Jinja2" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "Qweb" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "E-mail de demonstração QWeb" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "Este é um modelo de e-mail usando o qweb." + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "Ver Arquitetura" diff --git a/email_template_qweb/i18n/zh_CN.po b/email_template_qweb/i18n/zh_CN.po new file mode 100644 index 000000000..66ad4ffe2 --- /dev/null +++ b/email_template_qweb/i18n/zh_CN.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * email_template_qweb +# +# Translators: +# Jeffery Chenn , 2016 +msgid "" +msgstr "" +"Project-Id-Version: social (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-02 00:46+0000\n" +"PO-Revision-Date: 2016-09-04 05:55+0000\n" +"Last-Translator: Jeffery Chenn \n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-social-9-0/" +"language/zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_id +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_id +msgid "Body View" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_type +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_type +msgid "Body templating engine" +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "Dear" +msgstr "亲爱的" + +#. module: email_template_qweb +#: model:ir.model,name:email_template_qweb.model_mail_template +msgid "Email Templates" +msgstr "Email 模板" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__jinja2 +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__jinja2 +msgid "Jinja2" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__email_template_preview__body_type__qweb +#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb +msgid "QWeb" +msgstr "" + +#. module: email_template_qweb +#: model:mail.template,subject:email_template_qweb.email_template_demo1 +msgid "QWeb demo email" +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,help:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,help:email_template_qweb.field_mail_template__body_view_arch +msgid "" +"This field should be used when accessing view arch. It will use " +"translation.\n" +" Note that it will read `arch_db` or `arch_fs` " +"if in dev-xml mode." +msgstr "" + +#. module: email_template_qweb +#: model_terms:ir.ui.view,arch_db:email_template_qweb.view_email_template_demo1 +msgid "This is an email template using qweb." +msgstr "" + +#. module: email_template_qweb +#: model:ir.model.fields,field_description:email_template_qweb.field_email_template_preview__body_view_arch +#: model:ir.model.fields,field_description:email_template_qweb.field_mail_template__body_view_arch +msgid "View Architecture" +msgstr "" diff --git a/email_template_qweb/migrations/15.0.1.0.0/pre-migration.py b/email_template_qweb/migrations/15.0.1.0.0/pre-migration.py new file mode 100644 index 000000000..9dc272db9 --- /dev/null +++ b/email_template_qweb/migrations/15.0.1.0.0/pre-migration.py @@ -0,0 +1,29 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, api + + +def migrate(cr, version): + if not version: + return + + env = api.Environment(cr, SUPERUSER_ID, {}) + body_type = env["ir.model.fields"].search( + [("name", "=", "body_type"), ("model", "=", "mail.template")] + ) + + # Note: no need to migrate the existing values of the `body_type` of the + # model `mail_template` because Odoo already does it + # See https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/models/ir_model.py#L1351 + if body_type: + # qweb -> qweb_view + qweb = env["ir.model.fields.selection"].search( + [("value", "=", "qweb"), ("field_id", "=", body_type.id)] + ) + qweb.write({"value": "qweb_view"}) + + # jinja2 -> qweb + jinja = env["ir.model.fields.selection"].search( + [("value", "=", "jinja2"), ("field_id", "=", body_type.id)] + ) + jinja.write({"value": "qweb"}) diff --git a/email_template_qweb/models/__init__.py b/email_template_qweb/models/__init__.py new file mode 100644 index 000000000..c4b95e3cc --- /dev/null +++ b/email_template_qweb/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import mail_template diff --git a/email_template_qweb/models/mail_template.py b/email_template_qweb/models/mail_template.py new file mode 100644 index 000000000..33dbbd2a9 --- /dev/null +++ b/email_template_qweb/models/mail_template.py @@ -0,0 +1,49 @@ +# Copyright 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import fields, models, tools + + +class MailTemplate(models.Model): + _inherit = "mail.template" + + body_type = fields.Selection( + [("qweb", "QWeb"), ("qweb_view", "QWeb View")], + "Body templating engine", + default="qweb", + required=True, + ) + body_view_id = fields.Many2one("ir.ui.view", domain=[("type", "=", "qweb")]) + body_view_arch = fields.Text(related="body_view_id.arch") + + def generate_email(self, res_ids, fields): + multi_mode = True + if isinstance(res_ids, int): + res_ids = [res_ids] + multi_mode = False + result = super(MailTemplate, self).generate_email(res_ids, fields=fields) + for lang, (_template, _template_res_ids) in self._classify_per_lang( + res_ids + ).items(): + self_with_lang = self.with_context(lang=lang) + for res_id in res_ids: + if self.body_type == "qweb_view" and ( + not fields or "body_html" in fields + ): + for record in self_with_lang.env[self.model].browse(res_id): + body_html = self_with_lang.body_view_id._render( + {"object": record, "email_template": self_with_lang} + ) + # Some wizards, like when sending a sales order, need this + # fix to display accents correctly + body_html = tools.ustr(body_html) + result[res_id][ + "body_html" + ] = self_with_lang._render_template_postprocess( + {res_id: body_html} + )[ + res_id + ] + result[res_id]["body"] = tools.html_sanitize( + result[res_id]["body_html"] + ) + return result if multi_mode else result[res_ids[0]] diff --git a/email_template_qweb/readme/CONTRIBUTORS.rst b/email_template_qweb/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..7d8120af9 --- /dev/null +++ b/email_template_qweb/readme/CONTRIBUTORS.rst @@ -0,0 +1,12 @@ +* Holger Brunn +* Dave Lasley +* Carlos Lopez Mite +* `Tecnativa `_: + + * Ernesto Tejeda + +* Thomas Fossoul (thomas@niboo.com) +* Phuc Tran Thanh +* Foram Shah +* `Trobz `_: + * Dzung Tran diff --git a/email_template_qweb/readme/CREDITS.rst b/email_template_qweb/readme/CREDITS.rst new file mode 100644 index 000000000..f5cc070c7 --- /dev/null +++ b/email_template_qweb/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Camptocamp diff --git a/email_template_qweb/readme/DESCRIPTION.rst b/email_template_qweb/readme/DESCRIPTION.rst new file mode 100644 index 000000000..7b4eec638 --- /dev/null +++ b/email_template_qweb/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module was written to allow you to write email templates in `QWeb view` instead +of QWeb. The advantage here is that with QWeb View, you can make use of +inheritance and the ``call`` statement, which allows you to reuse designs and +snippets in multiple templates, making your development process simpler. +Furthermore, QWeb views are easier to edit with the integrated ACE editor. diff --git a/email_template_qweb/readme/USAGE.rst b/email_template_qweb/readme/USAGE.rst new file mode 100644 index 000000000..e28141b24 --- /dev/null +++ b/email_template_qweb/readme/USAGE.rst @@ -0,0 +1,5 @@ +To use this module, you need to: + +#. Select `QWeb View` in the field `Body templating engine` +#. Select a `QWeb View` to be used to render the body field +#. Apart from `QWeb View` standard variables, you also have access to ``object`` and ``email_template``, which are browse records of the current object and the email template in use, respectively. diff --git a/email_template_qweb/static/description/icon.png b/email_template_qweb/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/email_template_qweb/static/description/icon.png differ diff --git a/email_template_qweb/static/description/index.html b/email_template_qweb/static/description/index.html new file mode 100644 index 000000000..3a46686fc --- /dev/null +++ b/email_template_qweb/static/description/index.html @@ -0,0 +1,467 @@ + + + + + + +QWeb for email templates + + + +
+

QWeb for email templates

+ + +

Beta License: AGPL-3 OCA/social Translate me on Weblate Try me on Runboat

+

This module was written to allow you to write email templates in QWeb view instead +of QWeb. The advantage here is that with QWeb View, you can make use of +inheritance and the call statement, which allows you to reuse designs and +snippets in multiple templates, making your development process simpler. +Furthermore, QWeb views are easier to edit with the integrated ACE editor.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Select QWeb View in the field Body templating engine
  2. +
  3. Select a QWeb View to be used to render the body field
  4. +
  5. Apart from QWeb View standard variables, you also have access to object and email_template, which are browse records of the current object and the email template in use, respectively.
  6. +
+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Camptocamp
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/email_template_qweb/tests/__init__.py b/email_template_qweb/tests/__init__.py new file mode 100644 index 000000000..b6c159304 --- /dev/null +++ b/email_template_qweb/tests/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import test_mail_template_qweb diff --git a/email_template_qweb/tests/test_mail_template_qweb.py b/email_template_qweb/tests/test_mail_template_qweb.py new file mode 100644 index 000000000..37fc70214 --- /dev/null +++ b/email_template_qweb/tests/test_mail_template_qweb.py @@ -0,0 +1,23 @@ +# Copyright 2016 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo.tests.common import TransactionCase + + +class TestMailTemplateQweb(TransactionCase): + def test_email_template_qweb(self): + template = self.env.ref("email_template_qweb.email_template_demo1") + mail_values = template.generate_email([self.env.user.id], ["body_html"]) + self.assertTrue( + # this comes from the called template if everything worked + "