Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] email_template_qweb: Migration to 15.0 #1072

Merged
merged 32 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ac433de
[ADD] email_template_qweb
lasley May 18, 2016
b91a17e
[FIX] Call to generate_email can be done with a list of ids or only o…
lmignon May 30, 2016
00aa465
[MIG] email_template_qweb: Migrated to 10.0
bouvyd Oct 11, 2016
daee701
[FIX] email_template_qweb: Decode body when encoded
pedrobaeza Oct 17, 2016
5ae4968
OCA Transbot updated translations from Transifex
oca-transbot May 22, 2016
5b7b097
[11][MIG] email_template_qweb: Migration to 11.0
celm1990 Mar 25, 2018
f9f725c
[UPD] Update email_template_qweb.pot
oca-travis Jun 17, 2018
ec3b55a
[MIG] email_template_qweb: Migration to 12.0
ernestotejeda Dec 12, 2018
48a4c37
[UPD] README.rst
OCA-git-bot Dec 20, 2018
5ae8ed0
[UPD] Update email_template_qweb.pot
oca-travis Dec 20, 2018
6e5a314
Update translation files
oca-transbot Dec 29, 2018
5701595
[UPD] README.rst
OCA-git-bot Jul 29, 2019
6ab0d55
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
17ba39b
Translated using Weblate (Portuguese (Brazil))
Sep 17, 2019
5382bde
[IMP] email_template_qweb: black, isort
tfossoul Jan 2, 2020
d2697b5
[MIG] email_template_qweb: Migration to 13.0
tfossoul Jan 2, 2020
8830fc3
[UPD] Update email_template_qweb.pot
oca-travis Jan 17, 2020
6e0ee0b
[UPD] README.rst
OCA-git-bot Jan 17, 2020
703a9e0
Update translation files
oca-transbot Jan 31, 2020
2feb0bf
Update translation files
oca-transbot Aug 16, 2020
5b2ef9a
[IMP] pre-commit run -a
Jan 26, 2021
acb36f7
[MIG] email_template_qweb: Migration to 14.0
phuctranfxvn Feb 23, 2021
43dec7b
[UPD] Update email_template_qweb.pot
oca-travis Feb 28, 2021
ec72cef
[UPD] README.rst
OCA-git-bot Feb 28, 2021
95d06b5
Translated using Weblate (French)
Yvesldff Mar 22, 2021
0030f88
Added translation using Weblate (French (France))
Yvesldff Apr 11, 2021
d5655dc
Translated using Weblate (French (France))
Yvesldff Apr 11, 2021
00e58b8
[FIX] email_template_qweb: get translations working
sebalix Mar 23, 2022
23454b0
email_template_qweb 14.0.1.0.1
OCA-git-bot Apr 22, 2022
1bd1fc2
[IMP] update dotfiles [ci skip]
OCA-git-bot Dec 11, 2022
71d6107
[IMP] email_template_qweb: black, isort, prettier
dzungtran89 Feb 14, 2023
71fdbcb
[MIG] email_template_qweb: Migration to 15.0
fshah-initos May 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions email_template_qweb/README.rst
Original file line number Diff line number Diff line change
@@ -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 <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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20email_template_qweb%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
~~~~~~~

* Therp BV

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

* Holger Brunn <hbrunn@therp.nl>
* Dave Lasley <dave@laslabs.com>
* Carlos Lopez Mite <celm1990@gmail.com>
* `Tecnativa <https://www.tecnativa.com>`_:

* Ernesto Tejeda

* Thomas Fossoul (thomas@niboo.com)
* Phuc Tran Thanh <phuc@trobz.com>
* Foram Shah <foram.shah@initos.com>
* `Trobz <https://trobz.com>`_:
* Dzung Tran <dungtd@trobz.com>

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 <https://github.com/OCA/social/tree/15.0/email_template_qweb>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions email_template_qweb/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
15 changes: 15 additions & 0 deletions email_template_qweb/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2016 Therp BV <http://therp.nl>
# 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,
}
42 changes: 42 additions & 0 deletions email_template_qweb/demo/ir_ui_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<template id="view_email_template_corporate_identity">
<body>
<html>
<img
style="float: right"
t-attf-src="data:image;base64,{{env.user.company_id.logo}}"
/>
<!-- if some template calling us sets this variable,
we print a h1 tag /-->
<h1 t-if="email_heading"><t t-esc="email_heading" /></h1>
<t t-out="0" />
<!-- use some standard footer if the user doesn't have
a signature /-->
<footer t-if="not email_use_user_signature">
<p>
<a t-att-href="env.user.company_id.website">
<t t-esc="env.user.company_id.name" />
</a>
</p>
<p><t t-esc="env.user.company_id.phone" /></p>
</footer>
<footer t-if="email_use_user_signature">
<t t-out="env.user.signature" />
</footer>
</html>
</body>
</template>
<template id="view_email_template_demo1">
<!-- because we can simply call the ci here, we don't need to
repeat it /-->
<t t-call="email_template_qweb.view_email_template_corporate_identity">
<!-- the template we call uses this as title if we set it /-->
<t t-set="email_heading" t-value="email_template.subject" />
<h2>Dear <t t-esc="object.name" />,</h2>
<p>
This is an email template using qweb.
</p>
</t>
</template>
</odoo>
10 changes: 10 additions & 0 deletions email_template_qweb/demo/mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="email_template_demo1" model="mail.template">
<field name="name">QWeb demo</field>
<field name="body_type">qweb_view</field>
<field name="body_view_id" ref="view_email_template_demo1" />
<field name="model_id" ref="base.model_res_users" />
<field name="subject">QWeb demo email</field>
</record>
</odoo>
80 changes: 80 additions & 0 deletions email_template_qweb/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * email_template_qweb
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
81 changes: 81 additions & 0 deletions email_template_qweb/i18n/email_template_qweb.pot
Original file line number Diff line number Diff line change
@@ -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 ""
Loading