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

[17.0][MIG] email_template_qweb #1361

Open
wants to merge 46 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a183a22
[ADD] email_template_qweb
lasley May 18, 2016
df6c586
[FIX] Call to generate_email can be done with a list of ids or only o…
lmignon May 30, 2016
037cb3b
[MIG] email_template_qweb: Migrated to 10.0
bouvyd Oct 11, 2016
3445f21
[FIX] email_template_qweb: Decode body when encoded
pedrobaeza Oct 17, 2016
3de328d
OCA Transbot updated translations from Transifex
oca-transbot May 22, 2016
0c6eb2a
[11][MIG] email_template_qweb: Migration to 11.0
celm1990 Mar 25, 2018
f2dbf23
[UPD] Update email_template_qweb.pot
oca-travis Jun 17, 2018
f1f19bf
[MIG] email_template_qweb: Migration to 12.0
ernestotejeda Dec 12, 2018
c2fa6b8
[UPD] README.rst
OCA-git-bot Dec 20, 2018
7a3261b
[UPD] Update email_template_qweb.pot
oca-travis Dec 20, 2018
69c00ad
Update translation files
oca-transbot Dec 29, 2018
08bf5be
[UPD] README.rst
OCA-git-bot Jul 29, 2019
0d30bbe
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
9666d11
Translated using Weblate (Portuguese (Brazil))
Sep 17, 2019
71b54b0
[IMP] email_template_qweb: black, isort
tfossoul Jan 2, 2020
8984f03
[MIG] email_template_qweb: Migration to 13.0
tfossoul Jan 2, 2020
bc66864
[UPD] Update email_template_qweb.pot
oca-travis Jan 17, 2020
5de3e7b
[UPD] README.rst
OCA-git-bot Jan 17, 2020
021b837
Update translation files
oca-transbot Jan 31, 2020
54d1896
Update translation files
oca-transbot Aug 16, 2020
53dcd70
[IMP] pre-commit run -a
Jan 26, 2021
835c02f
[MIG] email_template_qweb: Migration to 14.0
phuctranfxvn Feb 23, 2021
38e59be
[UPD] Update email_template_qweb.pot
oca-travis Feb 28, 2021
5d500e3
[UPD] README.rst
OCA-git-bot Feb 28, 2021
471128e
Translated using Weblate (French)
Yvesldff Mar 22, 2021
1b84849
Added translation using Weblate (French (France))
Yvesldff Apr 11, 2021
9080f51
Translated using Weblate (French (France))
Yvesldff Apr 11, 2021
f9ccd18
[FIX] email_template_qweb: get translations working
sebalix Mar 23, 2022
199cb00
email_template_qweb 14.0.1.0.1
OCA-git-bot Apr 22, 2022
25490e5
[IMP] update dotfiles [ci skip]
OCA-git-bot Dec 11, 2022
c4c10c4
[MIG] email_template_qweb: Migration to 15.0
fshah-initos May 3, 2022
b7b400e
[UPD] Update email_template_qweb.pot
Mar 20, 2023
82a063e
[UPD] README.rst
OCA-git-bot Mar 20, 2023
ef2ceb9
[16.0][MIG] email_template_qweb: Migration to 16.0
dzungtran89 Mar 21, 2023
e255900
[UPD] Update email_template_qweb.pot
May 15, 2023
1cfe137
[UPD] README.rst
OCA-git-bot May 15, 2023
954f04c
Update translation files
weblate May 15, 2023
f80cc7b
Translated using Weblate (Italian)
mymage Jul 24, 2023
cfdf628
[UPD] README.rst
OCA-git-bot Sep 3, 2023
d8bc9ed
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
718c13f
Translated using Weblate (Italian)
mymage Sep 26, 2023
ee8c5f7
Translated using Weblate (Italian)
mymage Dec 1, 2023
63e0ab0
Translated using Weblate (Italian)
mymage Dec 1, 2023
8fe27da
Translated using Weblate (Portuguese (Brazil))
adrianojprado Dec 22, 2023
28acbb2
[IMP] email_template_qweb: pre-commit auto fixes
AnaisLForgeFlow Apr 29, 2024
912b94e
[MIG] email_template_qweb: Migration to 17.0
AnaisLForgeFlow May 6, 2024
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
121 changes: 121 additions & 0 deletions email_template_qweb/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
========================
QWeb for email templates
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f34eb5d597bb6e375fee10d4f9edc4908631034be7f187d151cd0deaedd3cfa3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/17.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-17-0/social-17-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/builds?repo=OCA/social&target_branch=17.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:

1. Go to *Settings / Email Templates* and create a new template
2. Select QWeb View in the field Body templating engine
3. 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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20email_template_qweb%0Aversion:%2017.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>

- Anaïs Lopez <anais.lopez@forgeflow.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/17.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
16 changes: 16 additions & 0 deletions email_template_qweb/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2016-2024 Therp BV <http://therp.nl>
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "QWeb for email templates",
"version": "17.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>
82 changes: 82 additions & 0 deletions email_template_qweb/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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_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_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__mail_template__body_type__qweb
msgid "QWeb"
msgstr "QWeb"

#. module: email_template_qweb
#: model:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb_view
msgid "QWeb View"
msgstr ""

#. module: email_template_qweb
#: model:mail.template,name:email_template_qweb.email_template_demo1
msgid "QWeb demo"
msgstr ""

#. 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_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_mail_template__body_view_arch
msgid "View Architecture"
msgstr "Zeige Stilarten"

#~ msgid "Jinja2"
#~ msgstr "Jinja2"
71 changes: 71 additions & 0 deletions email_template_qweb/i18n/email_template_qweb.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * email_template_qweb
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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,name:email_template_qweb.model_mail_template
msgid "Email Templates"
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:ir.model.fields.selection,name:email_template_qweb.selection__mail_template__body_type__qweb_view
msgid "QWeb View"
msgstr ""

#. module: email_template_qweb
#: model:mail.template,name:email_template_qweb.email_template_demo1
msgid "QWeb demo"
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
Loading