Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Translations

by
NICO SOLUTIONS - ENGINEERING & IT
, Nils Coenen
- 28/02/2025 08:48:44

Hey OCA,

I have a kind of „basic“ question I guess, regarding the handling of mail templates and its translations.

 

If I need to overwrite email templates that are used „hard-coded“ in Odoo core create/write methods, what is the best way to do so.

 

- 1st: Set the email template noupdate flag to false using the write function, then overwrite the template with your own record and set the noupdate flag back to true.

 

The new template is now correct using create method of Odoo core. But here I have the problem that I cannot process the translations for the template correctly as they are referred to the Odoo core module. 

 

- 2nd: Create „my module“-specific mail templates and load the records on module installation in addition to the original Odoo mail templates. This makes things easier concerning the translation po files.

 

The Problem: as the original core code is using the hard-coded mail templates, I need to rebuild the whole logic from Odoo core in create and writes method in my module and include my adaptions.

 

 

So in general… what is the better approach… or maybe a totally different one?

 

Is it possible to override the Core module translations properly when a template is “replaced” by custom module?

 

All the best

Nils