summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2018-12-31 14:20:29 +0000
committerRomainLibert <rli@odoo.com>2018-12-31 14:20:29 +0000
commit6d02b7c2e9a67826c0b81bb01a431ba09469620e (patch)
tree098c5d3b13b8586fd7d4c64462e6a55181c4eaba /addons
parentc0104303c636a906df971bfcdd9dabd5e2d485b4 (diff)
[FIX] gamification: add space in generated query
The generated query in _generate_goals_from_challenge lacked spaces between the date clause, which caused a traceback. The traceback only appears since v12 and above, because the dates are now casted as dates (::date) in SQL, which has to be followed by a space. Before that it was "fine" as SQL does allow you to write g.start_date = '10-10-2017'and g.end_date = '11-11-2017' Closes #28773 closes odoo/odoo#29836
Diffstat (limited to 'addons')
-rw-r--r--addons/gamification/models/challenge.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index fc18220eae4..1237a990e40 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -344,12 +344,12 @@ class Challenge(models.Model):
date_clause = ""
query_params = [line.id]
if start_date:
- date_clause += "AND g.start_date = %s"
+ date_clause += " AND g.start_date = %s"
query_params.append(start_date)
if end_date:
- date_clause += "AND g.end_date = %s"
+ date_clause += " AND g.end_date = %s"
query_params.append(end_date)
-
+
query = """SELECT u.id AS user_id
FROM res_users u
LEFT JOIN gamification_goal g