Disable a button based on CONDITION in Odoo?
<p>How can i add disabled class with attributes to field based on CONDITION?</p>

<p>I tried as below methods,</p>

<p>1) </p>

<pre><code>&lt;t t-if="product.qty_available &amp;lt;= 0"&gt;
    &lt;attribute name="class"&gt;btn btn-primary btn-lg mt8 js_check_product a-submit disabled&lt;/attribute&gt;
&lt;/t&gt;
</code></pre>

<hr>

<p>2) </p>

<pre><code>&lt;attribute name="class" t-if="product.qty_available &amp;gt; 0"&gt;btn btn-primary btn-lg mt8 js_check_product a-submit disabled&lt;/attribute&gt;
</code></pre>

<hr>

<p>3)</p>

<pre><code>&lt;attribute name="class" &gt;product.qty_available &amp;gt; 0 and 'btn btn-primary btn-lg mt8 js_check_product a-submit' or 'btn btn-primary btn-lg mt8 js_check_product a-submit disabled'&lt;/attribute&gt;
</code></pre>

<hr>

<p>Can some one helping me to achieve this?</p>