Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Qweb: object is not callable in odoo

By
Drees Far
on 6/29/16, 4:10 AM 234 views

Hello everybody!!!

I am working with qweb to print a report.

So, i have a field in which i get the date of the day:

Here is my python:

            'get_date_print': self.get_date_print,

and the function is:

    def get_date_print(self, context=None):

res_list=[]

res_list = datetime.now().strftime('%d-%m-%Y')

return res_list


in the qweb i have this:

<p style="float:left;text-align: left;">

<strong>Date de Jour:

<span t-esc="get_date_print()"/>

</strong>

</p>

the problem is that i get this error:

get_date_print: object is not callable.

How can i please resolve this problem.

Can anyone help.

Thanks a lot in advance.

0

Pawan

--Pawan--
1267
| 4 3 5
Hyderabad, India
--Pawan--


Pawan
On 6/29/16, 9:27 AM

Drees,

Please use your object reference to call that method as,

<span t-esc="o.get_date_print()"/>, here 'o' is the reference to the object,

Hope it help!

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/29/16, 4:10 AM
Seen: 234 times
Last updated: 6/29/16, 9:27 AM