[MERGE] Merge with lp:openobject-addons
authorSbh (OpenERP) <sbh@tinyerp.com>
Thu, 25 Nov 2010 05:03:18 +0000 (10:33 +0530)
committerSbh (OpenERP) <sbh@tinyerp.com>
Thu, 25 Nov 2010 05:03:18 +0000 (10:33 +0530)
bzr revid: sbh@tinyerp.com-20101125050318-9xpv65nstz8i4xwf

1  2 
addons/base_report_creator/base_report_creator.py

@@@ -34,17 -34,15 +34,15 @@@ class report_creator(osv.osv)
      # Should request only used fields
      #
      def export_data(self, cr, uid, ids, fields_to_export, context=None):
          if context is None:
              context = {}
          data_l = self.read(cr, uid, ids, ['sql_query'], context)
          final_datas = []
          #start Loop
-         for i in data_l:
+         for record in data_l:
              datas = []
-             for key, value in i.items():
-                 if key not in fields_to_export:
-                     continue
+             for key in fields_to_export:
+                 value = record.get(key,'')
                  if isinstance(value, tuple):
                      datas.append(ustr(value[1]))
                  else:
      _columns = {
          'name': fields.char('Report Name', size=64, required=True),
          'type': fields.selection([('list', 'Rows And Columns Report'), ], 'Report Type', required=True), #('sum','Summation Report')
 -        'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the report without removing it."),
 +        'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the report without removing it."),
          'view_type1': fields.selection([('form', 'Form'),
                                          ('tree', 'Tree'),
                                          ('graph', 'Graph'),