Odoo qweb call python method
<p>I want to modify the RFQ report and in that I wanted to call a python method from the Qweb report, </p>

<p>here is some sample code,</p>

<pre><code>&lt;span t-field ="o.my_custom_fuction()" /&gt;
</code></pre>

<p>and my python function is like</p>

<pre><code>@api.model
def my_custom_function(self):
    return "some_value"
</code></pre>

<p>But it is giving me error like 
qwebException : "my_custom_function()" while evaluating.</p>

<p>Any clue what I am missing?</p>

<blockquote>
  <blockquote>
    <p>The t-field directive can only be used when performing field access (a.b) on a "smart" record (result of the browse method). </p>
  </blockquote>
</blockquote>

<p>To call that function You will need to use <code>t-esc</code> (takes an expression, evaluates it and prints the content):  </p>

<pre><code>&lt;span t-esc ="o.my_custom_fuction()" /&gt;
</code></pre>

<p>I used <a href="https://www.odoo.com/documentation/8.0/reference/qweb.html" rel="nofollow">Odoo QWEB reference</a></p>

python openerp odoo-8 odoo-9