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

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
2581
1
مايو 25
3147
1
أبريل 25
2989
1
فبراير 25
2316
0
أكتوبر 24
1925