Odoo Help


Fields 'Time ' in openerp 7.0

on 5/23/13, 11:01 AM 10,228 views

There is no field called fields.time in openerp 7.0 how can i achieve this to have only timeWhat is the use of context and get_default method in open erp . As i am new to this , can anyone expalin clearly with example

Note :Widget="float_time" doesnt work instead of time becoz it is allowing to type 99.00 also . Time is only 00.00 - 24.00 ???


Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--

| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 5/25/13, 11:53 AM


in openerp to display time you can use field.float in python and add attribute widget="float_time for this field.

to limit to 23 hours, 59 minutes and 59 seconds, add an onchange function to test the time, return a raise if this is not the case, for convertion between float time and time date, use "import math" and method math.floor(.....).


ThankYou For the valuble Comment :-) Let me try it:-)

on 6/6/13, 11:54 AM

Hi, can you give me an example of how to convert the time data to a float time?.

on 7/12/13, 5:14 PM

Ghanshyam Prajapati

--Ghanshyam Prajapati--

| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 7/15/13, 4:20 AM

Hi Arun,

See Following example,

in py file,

start_time: fields.float('Start Time')

in xml file,

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

Hope it works for you.

Becouse How To Select Time ???

on 8/5/13, 5:43 AM

'created_time': fields.float('Time'), <field name="created_time" widget="float_time"/> it is not working

on 4/8/14, 7:59 AM
On 4/6/16, 7:45 AM

try this one, it working ..

'duration': fields.integer('Duration', required=True),

 <field name="duration" widget="float_time" class="oe_inline" attrs="{ 'invisible': True }"/>

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 5/23/13, 11:01 AM
Seen: 10228 times
Last updated: 4/6/16, 7:45 AM