[Merge] Merged branch of Dhruti for the fix of exportation
authorJay Vora (OpenERP) <jvo@tinyerp.com>
Wed, 30 Mar 2011 05:05:03 +0000 (10:35 +0530)
committerJay Vora (OpenERP) <jvo@tinyerp.com>
Wed, 30 Mar 2011 05:05:03 +0000 (10:35 +0530)
lp bug: https://launchpad.net/bugs/737586 fixed

bzr revid: jvo@tinyerp.com-20110330050503-8byk1p7hgdn9s5ji

bin/osv/orm.py

index cca43e1..1264433 100644 (file)
@@ -542,10 +542,12 @@ class orm_template(object):
                                 if not data[fpos]:
                                     dt = ''
                                     for rr in r :
-                                        if isinstance(rr.name, browse_record):
-                                            rr = rr.name
-                                        rr_name = self.pool.get(rr._table_name).name_get(cr, uid, [rr.id], context=context)
-                                        rr_name = rr_name and rr_name[0] and rr_name[0][1] or ''
+                                        rr_name = ''
+                                        if rr.name:
+                                            if isinstance(rr.name, browse_record):
+                                                rr = rr.name
+                                            rr_name = self.pool.get(rr._table_name).name_get(cr, uid, [rr.id], context=context)
+                                            rr_name = rr_name and rr_name[0] and rr_name[0][1] or ''
                                         dt += tools.ustr(rr_name or '') + ','
                                     data[fpos] = dt[:-1]
                                     break