Don't hardcode True in SQL query to be backend independent
This commit is contained in:
1 parent
2af99b9072
commit
8f1c983f7b
1 file changed
+2
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in new issue
Block a user