Skip to Content
Menu
This question has been flagged
1 Reply
4925 Views

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
Discard
Best Answer

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
Discard