Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5493 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona