Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
6 Răspunsuri
7304 Vizualizări

Hello Everyone,

I want know how to check html type field have value or not ?

Example:

I have one field like report_rich which is html type field.

So how to check value of report_rich available or not

Thanks in advance, 

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Hello

Please refer this link, May be helpful

https://www.odoo.com/forum/help-1/question/check-if-html-field-is-empty-on-qweb-report-135060

Imagine profil
Abandonează
Cel mai bun răspuns

Hello You just print your report and see ..

And

Define Your Html field in qweb template like below :

<div>
  <span style="font-size:10px;" t-field="doc.report_rich"/>
</div>

I hope it's help you.

Imagine profil
Abandonează
Autor

Hello Manish,

Thanks for your answer.

I want to skip some portion if not have value of report_rich field.

How can achieve this ?

Just add your if else condition in your qweb

for example

<t t-if="p.code == 'BASIC'">

executable statement..

</t>

for false condition,

<t t-if="not p.code == 'BASIC'">

executable statement..

</t>

Cel mai bun răspuns

Dear ,

Try to use if statement like this:


<t t-if="o.report_rich">
<span t-field="o.report_rich"/>
</t>


Hope  help you ...


Imagine profil
Abandonează
Autor

I have tried your code, but not working.