İçereği Atla
Menü
Bu soru işaretlendi
4 Cevaplar
7664 Görünümler

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?

Avatar
Vazgeç

check the widget float_time

En İyi Yanı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!

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
En İyi Yanı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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Eki 23
6338
2
Kas 22
6746
0
Eyl 21
2845
2
Mar 20
11503
2
Ara 19
2613