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

How to add Time field in modles database in odoo 15?

In views

field name="time" widget="float_time"/>

In Py
time = fields.Float('Time')



This method is not working as when you try to record time format such 10:50, invalid error message shows. in order to save the window after editing i have to record time format in float like 10.50 but when saving, it appears in the report 10:39 in time format.

another problem when i import excel sheet consisting of times, it show me an error that i can not import




อวตาร
ละทิ้ง

Hi, I tried here with 10:50 as input and I could not produce the error. It is working in my end. Can you please send the error message when you try with 10:50 format input?

ผู้เขียน

invalid fields with red block around the field....and enable to save until i change the 10:50 time format to 10.50 as float which result in 10:39 in report

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

Hi,

If your issue is that the values are not shown correctly in qweb report, add this t-options="{'widget': 'float_time'}" along with the field in the report template.

Thanks & Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มิ.ย. 25
1879
3
ก.ค. 25
3485
1
พ.ค. 25
1614
1
พ.ค. 25
1855
4
พ.ค. 25
2970