[FIX] Expression calculation for Datetime Corrected

lp bug: https://launchpad.net/bugs/405921 fixed

bzr revid: jvo@tinyerp.com-20090730085145-mqd5phn8ynyxvt4l
This commit is contained in:
AME(Tiny/Axelor) 2009-07-30 14:21:45 +05:30 committed by Jay (Open ERP)
parent ed3234e3c0
commit 06460f8bf5
1 changed files with 6 additions and 1 deletions

View File

@ -200,11 +200,16 @@ class expression(object):
# other field type
# add the time part to datetime field when it's not there:
if field._type == 'datetime' and self.__exp[i][2] and len(self.__exp[i][2]) == 10:
self.__exp[i] = list(self.__exp[i])
if operator in ('>', '>='):
self.__exp[i][2] += ' 00:00:00'
elif operator in ('<', '<='):
self.__exp[i][2] += ' 23:59:59'
self.__exp[i] = tuple(self.__exp[i])
if field.translate:
if operator in ('like', 'ilike', 'not like', 'not ilike'):
right = '%%%s%%' % right