[FIX]document_ics : solved accent problem
authorHarry (Open ERP) <hmo@tinyerp.com>
Fri, 23 Oct 2009 05:39:40 +0000 (11:09 +0530)
committerHarry (Open ERP) <hmo@tinyerp.com>
Fri, 23 Oct 2009 05:39:40 +0000 (11:09 +0530)
lp bug: https://launchpad.net/bugs/458415 fixed

bzr revid: hmo@tinyerp.com-20091023053940-px64bjhm0fvypu52

addons/document_ics/document.py

index 048a82c..2d70f3f 100644 (file)
@@ -128,6 +128,7 @@ class document_directory_content(osv.osv):
                 event.add('last-modified').value = ics_datetime(perm[0]['write_date'][:19])
             for field in node.content.ics_field_ids:
                 value = getattr(obj, field.field_id.name)
+                value = value and tools.ustr(value)
                 if (not value) and field.name=='uid':
                     value = 'OpenERP-%s_%s@%s' % (node.content.ics_object_id.model, str(obj.id), cr.dbname,)
                     obj_class.write(cr, uid, [obj.id], {field.field_id.name: value})
@@ -146,7 +147,7 @@ class document_directory_content(osv.osv):
                     else:
                         value = ics_datetime(value)
                     event.add(field.name).value = value
-        s= StringIO.StringIO(cal.serialize().encode('utf8'))
+        s= StringIO.StringIO(cal.serialize())
         s.name = node
         cr.commit()
         return s