跳至內容
選單
此問題已被標幟
3 回覆
42856 瀏覽次數

Hi

    any one knows how to get only time in a field like fields.Time() to store only time that i select

i want a field which can store only time .

頭像
捨棄
最佳答案

Hi,

You can add Time fields through this way

Python:

time = fields.Float(string='Time', compute="_compute_time")

Xml:

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

You can calculate the time using the compute function.

Thank you.

頭像
捨棄
最佳答案

you can try it

python

time = fields.float('Duration in hours ')

 view
<
field name='time' widget='float_time' />

頭像
捨棄
作者 最佳答案

thank you but

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

i try it before ,it shows value in formate like (11:56) and want to store value in like (11:52:12) format, and value is selected  by user like happening  in datetime field.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
8月 17
5673
1
12月 16
5949
3
5月 25
1623
1
4月 25
1228
3
9月 24
14086