コンテンツへスキップ
メニュー
この質問にフラグが付けられました
6 返信
7417 ビュー

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, 

アバター
破棄
著作者 最善の回答

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

アバター
破棄
最善の回答

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.

アバター
破棄
著作者

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>

最善の回答

Dear ,

Try to use if statement like this:


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


Hope  help you ...


アバター
破棄
著作者

I have tried your code, but not working.