Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How to change the default email template when sending by email a quotation, sales order, invoice ...

形象
odoo
2 注释
形象
丢弃
形象
odoo
-

that is a very clear explanation.
I wonder why, for a simple action like changing a default template, still in ODOO V15, the user shall go thru such nightmare...

形象
odoo
-

Another approach is (1) Copy the default template. (2) Rename the original so you know it is custom, and make any edits you like. This will be the template that is the default, since it is really still the original, just with changes. (3) Rename the copy with (original) at the end, so you have it in case the one you modify is not suitable for all Use Cases. We recommend taking a copy just so you will always have a working template, but this isn't even necessary for everyone - the default template is a default, and any edits you make will persist during upgrades.

1 答案
0
形象
odoo
最佳答案

Let's consider the case in which we want to change the default email template Sales order: Confirmation Email on a sales order (screenshot below).


Here are the steps to follow;

1. Activate debug mode

2. Go in Settings -> Technical -> Emails -> Templates

Open the new email template that you wish to set as default. 
In its URL (check that you are on debug mode) find the id number of the email template


In this example the id of your email template is 78.

Repeat this and also get the id of the original email template (here let’s say its 54)


3. Then go back in Settings -> Technical -> Sequence & Identifiers -> External Identifiers
Search on the 1) record id of the original default email template that you want to replace (ex 54 here)
+ add a filter on 2) external identifiers with the value "template" 

Open the right record according to what you want to change.


Indicate the new id = 78 (for this example) and save.
Note that the Record (name of the email template) updated into the new default email template that you chose.



4. Make first a copy the original default email template, then delete the original.

Without this step, the default won't change properly. You still want to keep the original on hand just in case you need it later.

5. Check out that it worked 



The default is set as your new report (here Sales Order: Confirmation email (custom copy))


NB: If you have mistakenly deleted the original built-in default email template BEFORE changing its id record in the external identifier into the new email template id,

then the external identifier will be deleted as well.

No panic, you can just recreate the external identifier. For that use a test database, locate the external id linked to the original report and reproduce the external ID in your db + link it with the right record id.

3 注释
形象
丢弃
形象
odoo
-

Very useful and well explained! Thank you Laure!

形象
odoo
-

Hi Laure. Perfect explanation! However, one question, when I change my 'default' template let's call it, this changes for all companies within my multi-company set-up. Is there a way to do this per company?

形象
odoo
-

Be sure to check the External ID of the template that appears in USE TEMPLATE is actually "sale.mail_template_sale_confirmation" (template named "Sales Order: Confirmation Email") because in some configurations it may be "sale.email_template_edi_sale" instead (template named "Sales Order: Send by email") so THAT is the one you want to change with the ID of the one you made.