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

Hi community,

Am facing this issue.

i have this field in my model : start_date: field.Float()

For instance, if 10:20 is inputed in form view it's okay but when printed in pdf i got 10.5

What could be the issue?

อวตาร
ละทิ้ง

check the widget float_time

คำตอบที่ดีที่สุด

I faced something similar in my Odoo 13. Solution:

In the model:

start_date = fields.Float ('Date')

In QWeb report:

<span t-esc = "doc.start_date" t-options= '{"widget": "float_time"}'/>

Hope this helps someone. Cheers!

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

long story short: <span t-field="start_date" t-field-options='{"format": "%H:%M"} />

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

Use odoo date field

start_date = fields.Date('Date')

Instead of float

start_date: field.Float()

And in qweb reports use

<span t-field="doc.start_date"/>

For more information visit

1- http://learnopenerp.blogspot.com/2016/11/how-to-create-qweb-reports-in-openerp.html

2- http://learnopenerp.blogspot.com/2016/09/how-to-create-custom-reports-in-odoo.html

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ต.ค. 23
6416
2
พ.ย. 22
6797
0
ก.ย. 21
2900
Create ticket from Email แก้ไขแล้ว
2
มี.ค. 20
11587
2
ธ.ค. 19
2661