Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5445 Weergaven

Hello I want to put a variable between <style> sentence on qweb reports

I already setting the variable on model and views, the variable will set the color for a table style, I tried with this sentence, but doesn't work:

<style type="text/css">
.title{
color:#<span t-esc="o.company_id.cr_invoice_color"/>;
font-size:24px;

</code>

Avatar
Annuleer
Beste antwoord

Hi,

to achieve this goal, you should have to load Style in template (e.g. frontend/backend assets)

In that, you can do like:

<t t-set="invoice_color" t-value="o.company_id.cr_invoice_color"/>

<style type="text/css">
.title{
color: #<t t-esc="invoice_color"/>;
}
</style>

I hope it will work for you.


Thanks and regards

Haresh Kansara

Avatar
Annuleer