Object is not callable
<p>I make this condition:</p>

<pre><code>if ((liste_mois[0]==3) or (liste_mois[0]==6) (liste_mois[0]==9) or (liste_mois[0]==12))
</code></pre>

<p>i got: TypeError: 'bool' object is not callable</p>

<p>You've got:</p>

<blockquote>
  <p>TypeError: 'bool' object is not callable</p>
</blockquote>

<p>just because you're doing something like that:</p>

<pre><code>(liste_mois[0]==6) (liste_mois[0]==9)
</code></pre>

<p>which could be represented as, let's say:</p>

<pre><code>(True) (False)
</code></pre>

<p>and going further:</p>

<pre><code>(True)()
</code></pre>

<p>so in your statement you treat boolean value <code>(liste_mois[0]==6)</code> as a function, because you're trying to invoke it. And because boolean value is not callable, that's the reason you see this error.</p>

<p>Similar example to <code>(liste_mois[0]==6) (liste_mois[0]==9)</code> could be:</p>

<pre><code>def something():
    pass

(something)() # &lt;-- this
</code></pre>

<p>So solution for you will be to put <code>or</code> in your <code>if</code> condition, so:</p>

<pre><code>if ((liste_mois[0]==3) or (liste_mois[0]==6) or (liste_mois[0]==9) or (liste_mois[0]==12))
</code></pre>

<p>and I think that is what you want.</p>

python python-2.7 odoo-8