[FIX] only Grouped field should appear in groupby clause, graph orientation corrected

bzr revid: jvo@tinyerp.com-20100519112251-gc8iubew30s4u5tf
This commit is contained in:
Jay (Open ERP)
2010-05-19 16:52:51 +05:30
parent 54245a5b8d
commit dbf0c490da
@@ -116,9 +116,11 @@ class report_creator(osv.osv):
arch = '<?xml version="1.0" encoding="utf-8"?>\n'
if view_type == 'graph':
arch += '<graph string="%s" type="%s" orientation="%s">' % (report.name, report.view_graph_type, report.view_graph_orientation)
orientation_eval = {'horz':'horizontal','vert' :'vertical'}
orientation = eval(report.view_graph_orientation,orientation_eval)
arch +='<graph string="%s" type="%s" orientation="%s">' % (report.name, report.view_graph_type, orientation)
i = 0
for val in ('x','y'):
i = 0
for f in report.field_ids:
if f.graph_mode == val:
if f.field_id.model:
@@ -372,9 +374,10 @@ class report_creator(osv.osv):
t = self.pool.get(f.field_id.model_id.model)._table
if f.group_method == 'group':
fields.append('\t'+t+'.'+f.field_id.name+' as field'+str(i))
groupby.append(t+'.'+f.field_id.name)
else:
fields.append('\t'+f.group_method+'('+t+'.'+f.field_id.name+')'+' as field'+str(i))
groupby.append(t+'.'+f.field_id.name)
i += 1
models = self._path_get(cr, uid, obj.model_ids, obj.filter_ids)
check = self._id_get(cr, uid, ids[0], context)