for record in self:
hours = 0
if record.clock_out_time and record.clock_in_time:
hours = (datetime.datetime.strptime(record.clock_out_time,'%Y-%m-%d %H:%M:%S')datetime.datetime.strptime(record.clock_in_time,'%Y%m-%d %H:%M:%S')).seconds/3600.0 - 9.5
for record in self:
hours = 0
if record.clock_out_time and record.clock_in_time:
hours = (datetime.datetime.strptime(record.clock_out_time,'%Y-%m-%d %H:%M:%S') datetime.datetime.strptime(record.clock_in_time,'%Y %m-%d %H:%M:%S')).seconds/3600.0 - 9.5
record ['x_after_office_time_hours'] = hours