Why can't I use CDATA in email template body in Odoo 11?how to insert image in template of odoo email notifications?email_from in Email Template Ignored OdooWhy have workflows been removed in Odoo v11?could not load template account.report_invoice_document_with_payments in Odoo 11How to modify e-mail body in chatter in Odoo 11There is a model named `hr.analytic.timesheet` in odoo-8 I can't find it in odoo-10 and odoo-11Can't see PDF Reports in Accounting -Odoo 11 EEOdoo 11e: Multi Company user can't save Quotations under 2nd company when custom module is installedodoo email template for sorted loop

Go to last file in vim

Locked Room Murder!! How and who?

In which case does the Security misconfiguration vulnerability apply to?

Why won't the Republicans use a superdelegate system like the DNC in their nomination process?

Should I leave building the database for the end?

How would timezones work on a planet 100 times the size of our Earth

How can I find an old paper when the usual methods fail?

Are there any lower-level means of travelling between planes of existence?

What are those bumps on top of the Antonov-225?

Doesn't the speed of light limit imply the same electron can be annihilated twice?

Do I have to cite common CS algorithms?

Does an object storing more internal energy emit more thermal radiation?

Identifying My Main Water Shutoff Valve / Setup

What kind of liquid can be seen 'leaking' from the upper surface of the wing of a Boeing 737-800?

Scam? Phone call from "Department of Social Security" asking me to call back

Do beef farmed pastures net remove carbon emissions?

Can lodestones be used to magnetize crude iron weapons?

Big number puzzle

Are there really no countries that protect Freedom of Speech as the United States does?

Running code generated in realtime in JavaScript with eval()

Luggage Storage at Szechenyi Baths

How far did Gandalf and the Balrog drop from the bridge in Moria?

A torrent of foreign terms

How did Arecibo detect methane lakes on Titan, and image Saturn's rings?



Why can't I use CDATA in email template body in Odoo 11?


how to insert image in template of odoo email notifications?email_from in Email Template Ignored OdooWhy have workflows been removed in Odoo v11?could not load template account.report_invoice_document_with_payments in Odoo 11How to modify e-mail body in chatter in Odoo 11There is a model named `hr.analytic.timesheet` in odoo-8 I can't find it in odoo-10 and odoo-11Can't see PDF Reports in Accounting -Odoo 11 EEOdoo 11e: Multi Company user can't save Quotations under 2nd company when custom module is installedodoo email template for sorted loop






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I was trying to create a new email template for invoices. What I did is to copy all the existing email template for invoices (xml id: email_template_edi_invoice) except for the body_html field. And here is the problem:



If I fill in the body_html using CDATA, I get the following asertion error:



Element odoo has extra content: data, line 6


However, if I do not use it, it works. I simplified the body_html content, but the problem is still there.



The following email template works:



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html">
<div>
Hola
</div></field>
</record>

</data>
</odoo>


The following email template does not work (gives the extra content error):



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html"><![CDATA[
<div>
Hola
</div>]]></field>
</record>

</data>
</odoo>


Can anyone who experienced this problem give me a hint of what is happening?










share|improve this question
























  • If you remove your <data></data> tags, you might get a more useful error. The data elements are no longer necessary unless you're wanting to use noupdate="1".

    – travisw
    Mar 27 at 15:41











  • @travisw I removed data tags but then the error message is Element odoo has extra content: record, line 8.

    – forvas
    Mar 27 at 15:47












  • Try using hard-coded values for everything to start? If it loads that, then slowly re-add the $... pieces until it breaks again.

    – travisw
    Mar 27 at 15:49

















3















I was trying to create a new email template for invoices. What I did is to copy all the existing email template for invoices (xml id: email_template_edi_invoice) except for the body_html field. And here is the problem:



If I fill in the body_html using CDATA, I get the following asertion error:



Element odoo has extra content: data, line 6


However, if I do not use it, it works. I simplified the body_html content, but the problem is still there.



The following email template works:



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html">
<div>
Hola
</div></field>
</record>

</data>
</odoo>


The following email template does not work (gives the extra content error):



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html"><![CDATA[
<div>
Hola
</div>]]></field>
</record>

</data>
</odoo>


Can anyone who experienced this problem give me a hint of what is happening?










share|improve this question
























  • If you remove your <data></data> tags, you might get a more useful error. The data elements are no longer necessary unless you're wanting to use noupdate="1".

    – travisw
    Mar 27 at 15:41











  • @travisw I removed data tags but then the error message is Element odoo has extra content: record, line 8.

    – forvas
    Mar 27 at 15:47












  • Try using hard-coded values for everything to start? If it loads that, then slowly re-add the $... pieces until it breaks again.

    – travisw
    Mar 27 at 15:49













3












3








3








I was trying to create a new email template for invoices. What I did is to copy all the existing email template for invoices (xml id: email_template_edi_invoice) except for the body_html field. And here is the problem:



If I fill in the body_html using CDATA, I get the following asertion error:



Element odoo has extra content: data, line 6


However, if I do not use it, it works. I simplified the body_html content, but the problem is still there.



The following email template works:



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html">
<div>
Hola
</div></field>
</record>

</data>
</odoo>


The following email template does not work (gives the extra content error):



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html"><![CDATA[
<div>
Hola
</div>]]></field>
</record>

</data>
</odoo>


Can anyone who experienced this problem give me a hint of what is happening?










share|improve this question














I was trying to create a new email template for invoices. What I did is to copy all the existing email template for invoices (xml id: email_template_edi_invoice) except for the body_html field. And here is the problem:



If I fill in the body_html using CDATA, I get the following asertion error:



Element odoo has extra content: data, line 6


However, if I do not use it, it works. I simplified the body_html content, but the problem is still there.



The following email template works:



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html">
<div>
Hola
</div></field>
</record>

</data>
</odoo>


The following email template does not work (gives the extra content error):



<?xml version="1.0" ?>
<odoo>

<data>
<!--Email template -->
<record id="email_template_edi_invoice_v8" model="mail.template">
<field name="name">Invoicing: Invoice email v8.0</field>
<field name="email_from">$(object.user_id.email and '&quot;%s&quot; &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')</field>
<field name="subject">$object.company_id.name Invoice (Ref $object.number or 'n/a')</field>
<field name="partner_to">$object.partner_id.id</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="account.account_invoices"/>
<field name="report_name">Invoice_$(object.number or '').replace('/','_')_$object.state == 'draft' and 'draft' or ''</field>
<field name="lang">$object.partner_id.lang</field>
<field name="body_html" type="html"><![CDATA[
<div>
Hola
</div>]]></field>
</record>

</data>
</odoo>


Can anyone who experienced this problem give me a hint of what is happening?







xml odoo odoo-11






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 10:04









forvasforvas

6,2766 gold badges33 silver badges87 bronze badges




6,2766 gold badges33 silver badges87 bronze badges















  • If you remove your <data></data> tags, you might get a more useful error. The data elements are no longer necessary unless you're wanting to use noupdate="1".

    – travisw
    Mar 27 at 15:41











  • @travisw I removed data tags but then the error message is Element odoo has extra content: record, line 8.

    – forvas
    Mar 27 at 15:47












  • Try using hard-coded values for everything to start? If it loads that, then slowly re-add the $... pieces until it breaks again.

    – travisw
    Mar 27 at 15:49

















  • If you remove your <data></data> tags, you might get a more useful error. The data elements are no longer necessary unless you're wanting to use noupdate="1".

    – travisw
    Mar 27 at 15:41











  • @travisw I removed data tags but then the error message is Element odoo has extra content: record, line 8.

    – forvas
    Mar 27 at 15:47












  • Try using hard-coded values for everything to start? If it loads that, then slowly re-add the $... pieces until it breaks again.

    – travisw
    Mar 27 at 15:49
















If you remove your <data></data> tags, you might get a more useful error. The data elements are no longer necessary unless you're wanting to use noupdate="1".

– travisw
Mar 27 at 15:41





If you remove your <data></data> tags, you might get a more useful error. The data elements are no longer necessary unless you're wanting to use noupdate="1".

– travisw
Mar 27 at 15:41













@travisw I removed data tags but then the error message is Element odoo has extra content: record, line 8.

– forvas
Mar 27 at 15:47






@travisw I removed data tags but then the error message is Element odoo has extra content: record, line 8.

– forvas
Mar 27 at 15:47














Try using hard-coded values for everything to start? If it loads that, then slowly re-add the $... pieces until it breaks again.

– travisw
Mar 27 at 15:49





Try using hard-coded values for everything to start? If it loads that, then slowly re-add the $... pieces until it breaks again.

– travisw
Mar 27 at 15:49












1 Answer
1






active

oldest

votes


















2














Looks otherwise valid but the attribute type=”html” could cause your error. Try without it like this



 ...
<field name="body_html"><![CDATA[
...





share|improve this answer

























  • That was the problem. Without type="html" works. Thank you @Veikko.

    – forvas
    Mar 29 at 8:50










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374516%2fwhy-cant-i-use-cdata-in-email-template-body-in-odoo-11%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Looks otherwise valid but the attribute type=”html” could cause your error. Try without it like this



 ...
<field name="body_html"><![CDATA[
...





share|improve this answer

























  • That was the problem. Without type="html" works. Thank you @Veikko.

    – forvas
    Mar 29 at 8:50















2














Looks otherwise valid but the attribute type=”html” could cause your error. Try without it like this



 ...
<field name="body_html"><![CDATA[
...





share|improve this answer

























  • That was the problem. Without type="html" works. Thank you @Veikko.

    – forvas
    Mar 29 at 8:50













2












2








2







Looks otherwise valid but the attribute type=”html” could cause your error. Try without it like this



 ...
<field name="body_html"><![CDATA[
...





share|improve this answer













Looks otherwise valid but the attribute type=”html” could cause your error. Try without it like this



 ...
<field name="body_html"><![CDATA[
...






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 5:54









VeikkoVeikko

1,2681 gold badge10 silver badges18 bronze badges




1,2681 gold badge10 silver badges18 bronze badges















  • That was the problem. Without type="html" works. Thank you @Veikko.

    – forvas
    Mar 29 at 8:50

















  • That was the problem. Without type="html" works. Thank you @Veikko.

    – forvas
    Mar 29 at 8:50
















That was the problem. Without type="html" works. Thank you @Veikko.

– forvas
Mar 29 at 8:50





That was the problem. Without type="html" works. Thank you @Veikko.

– forvas
Mar 29 at 8:50








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374516%2fwhy-cant-i-use-cdata-in-email-template-body-in-odoo-11%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현