OdooWiki OCA HUB

QWeb for email templates

email_template_qweb folder_open OCA/social open_in_new
Marketing License: AGPL-3

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.

auto_awesome What this module does

AI-generated from the code · Odoo 16.0

Lets you write email templates as QWeb views instead of plain HTML, so you can reuse and inherit designs across multiple templates. A new 'Body templating engine' choice appears on email templates.

This module adds a new option to email templates in Odoo. On each template you now choose a 'Body templating engine': either the standard QWeb (the usual HTML body) or 'QWeb View'.

When you pick 'QWeb View', the normal body field is hidden and two new fields appear: a QWeb view to use as the body, and a read-only preview of that view's content shown in an editor. The QWeb view field is required in this mode.

  • The list of email templates also shows the chosen templating engine, so you can see at a glance which templates use QWeb views.
  • When an email is generated, if the template uses a QWeb View, the module renders that view for each recipient, in the recipient's language, and uses the result as the email body.
  • The rendered body is then processed and sanitised like a normal email body, so it behaves the same way once sent.
  • The demo shows a reusable 'corporate identity' view (logo, heading, footer or user signature) that other templates can call and extend, avoiding repetition.

It touches the mail.template model and the email template form and list screens. No new menus are added.

Depends on

mail
Models and fields (1)
  • mail.template · extends an existing modelbody_type, body_view_id, body_view_arch

Text generated by AI (DeepSeek) from reading the Odoo 16.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 5 confirmed, 4 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 16.0

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.

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.