Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4065 Zobrazení

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.

Avatar
Zrušit
Nejlepší odpověď

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!

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvc 23
6300
1
čvn 23
4320
1
dub 23
5041
1
lis 22
3753
1
říj 21
12079