تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
32341 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يوليو 25
1964
1
مايو 25
2053
1
أبريل 25
2485
1
فبراير 25
1757
0
أكتوبر 24
1497