Don't hardcode True in SQL query to be backend independent

This commit is contained in:
Cédric Krier committed 2010-07-01 20:47:30 +02:00
1 parent 2af99b9072
commit 8f1c983f7b
1 file changed
+2 -2
+2 -2
View File
@@ -149,7 +149,7 @@ class HoursEmployee(ModelSQL, ModelView):
if context is None:
context = {}
clause = ' '
args = []
args = [True]
if context.get('start_date'):
clause += 'AND date >= %s '
args.append(context['start_date'])
@@ -164,7 +164,7 @@ class HoursEmployee(ModelSQL, ModelView):
'employee, ' \
'SUM(COALESCE(hours, 0)) AS hours ' \
'FROM timesheet_line ' \
'WHERE True ' \
'WHERE %s ' \
+ clause + \
'GROUP BY employee', args)