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

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?

Ảnh đại diện
Huỷ bỏ

check the widget float_time

Câu trả lời hay nhất

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!

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

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

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

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 23
6391
2
thg 11 22
6764
0
thg 9 21
2872
2
thg 3 20
11533
2
thg 12 19
2642