fix grid groupby with more than 2 Fields in the expression

This commit is contained in:
ilvalle
2014-09-03 19:30:22 +02:00
parent d1e4ede9b3
commit 9b9a5034ad
+2
View File
@@ -2111,6 +2111,8 @@ class SQLFORM(FORM):
field_id = groupby #take the field passed as groupby
elif groupby and isinstance(groupby, Expression):
field_id = groupby.first #take the first groupby field
while not(isinstance(field_id, Field)): # Navigate to the first Field of the expression
field_id = field_id.first
table = field_id.table
tablename = table._tablename
if not any(str(f) == str(field_id) for f in fields):