Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1438 Lượt xem

Hi, im using odoo 17,  i create a field in odoo studio called  x_studio_fecha_finalizacin.

Im trying to compare the field with today date like this:
 <t t-if="job.x_studio_fecha_finalizacin &gt; today()"> 
             <p>Finalizado</p>                                                
 </t>

This is the error:

Error while render the template
TypeError: 'NoneType' object is not callable
Template: website_hr_recruitment.index
Path: /t/t/div/div[2]/div/div[2]/div/div/div/a/div/div[3]/div[2]/t[1]
Node: <t t-if="job.x_studio_fecha_finalizacin &gt; today()"/>



  
I see de today() method in the qweb documentation

Any idea?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello, 


try :


<t t-if="job.x_studio_fecha_finalizacin and job.x_studio_fecha_finalizacin &gt; datetime.date.today()">

    <p>Finalizado</p>                                               

</t>


Best regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
6
thg 1 24
12688
1
thg 4 25
1208
2
thg 3 25
1345
4
thg 11 24
7065
1
thg 3 24
1984