From 8cb13c4e4cb13f786fced69398ac661dcd1310b9 Mon Sep 17 00:00:00 2001 From: mge-odoo Date: Wed, 8 Feb 2017 15:51:22 +0100 Subject: [PATCH] [FIX] openerp: quote read_group SQL query for case sensitive tables In SQL, if there is no quote around the table/field, the result will be returned as case insensitive. This was causing a bug in the kanban view which was not displaying the records because x_AA_count was named x_aa_count. --- openerp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/models.py b/openerp/models.py index b13139de47f..3b0fda5bc54 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -2127,7 +2127,7 @@ class BaseModel(object): prefix_term = lambda prefix, term: ('%s %s' % (prefix, term)) if term else '' query = """ - SELECT min(%(table)s.id) AS id, count(%(table)s.id) AS %(count_field)s %(extra_fields)s + SELECT min("%(table)s".id) AS id, count("%(table)s".id) AS "%(count_field)s" %(extra_fields)s FROM %(from)s %(where)s %(groupby)s