Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
32230 มุมมอง

No matter the date is '2019-12-31' or not,still display in the QWEB report.What is the correct format of date in QWEB report?
*.py
resign_date = fields.Date(string="Resign Date", default="2019-12-31")

report/*.xml
<t t-if="l.resign_date != '2019-12-31'">
    <span t-field="l.resign_date"/>
</t>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try this format 


<span t-field="l.resign_date" t-options='{"widget": "date","format": "dd-MM-yyyy"}'/>


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

<span t-field="l.resign_date" t-options='{"format": "MM/dd/yyyy"}'/>

อวตาร
ละทิ้ง
ผู้เขียน

But the default date '2019-12-31' still display in the report

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 25
1819
1
พ.ค. 25
1909
QWeb: use t-if to check birthday date แก้ไขแล้ว
1
เม.ย. 25
2363
1
ก.พ. 25
1659
0
ต.ค. 24
1433