diff options
| author | Jay (Open ERP) <jvo@tinyerp.com> | 2010-05-19 16:52:51 +0530 |
|---|---|---|
| committer | Jay (Open ERP) <jvo@tinyerp.com> | 2010-05-19 16:52:51 +0530 |
| commit | dbf0c490da7ad949900a0bf5ab2934dfd9b3c4f1 (patch) | |
| tree | 549870650143e7cf564bbe86a816d6139984f454 | |
| parent | 54245a5b8d2f1608c49686b5ff6dc0fa7593abda (diff) | |
[FIX] only Grouped field should appear in groupby clause, graph orientation corrected
bzr revid: jvo@tinyerp.com-20100519112251-gc8iubew30s4u5tf
| -rw-r--r-- | addons/base_report_creator/base_report_creator.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index 33c2608c85a..615c0d059c3 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -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) |
