Link to home
Start Free TrialLog in
Avatar of Ravi soni
Ravi soni

asked on

How to set time in odoo and compare with other time.

question:1---I have 4 fields early and also have one to many lines where there is list of date and time.
now i want to compare first item of list with fixed date and result goes to early.
for example:
i have list of datetime. now i want to compare first item of list with that fixed time.
list like=[01/02/2017 11:00:00] [01/02/2017 12:00:00] [01/02/2017 13:00:00]
from here pick first list item time only that is 11:00:00
and compare with fixed time which we will fixed like=10:00:00
now difference of both time goes to early field..
please anyone tell me how to do this.


question2:-----please tell me how to set any time(i.e. i want some fixed time 10:00:00). how to set in odoo.
becoz i tired this:-
from datime import datetime
@api.onchange("employee_is")
def _onchange(self):
fixed_time = datetime.datetime.now("%h,%m,%s","10:00:00")

Open in new window

please tel me is this correct way to set fixed random time.
ASKER CERTIFIED SOLUTION
Avatar of Flabio Gates
Flabio Gates

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial