[IMP] correctly handle empty m2o field serialization

bzr revid: xmo@openerp.com-20131014105621-mwiucen7glajccea
This commit is contained in:
Xavier Morel 2013-10-14 12:56:21 +02:00
parent 9cf7418b18
commit 625f4e253f
1 changed files with 2 additions and 0 deletions

View File

@ -565,6 +565,8 @@ class ManyToOneConverter(osv.AbstractModel):
_inherit = 'ir.qweb.field'
def value_to_html(self, cr, uid, value, column, options=None):
# value may be a browse_null
if not value: return ''
return werkzeug.utils.escape(value.name_get()[0][1]).replace('\n', '<br>\n')
class HTMLConverter(osv.AbstractModel):