[IMP] events

bzr revid: fp@openerp.com-20130928164336-6exrohfc2ek4d2y5
This commit is contained in:
Fabien Pinckaers 2013-09-28 18:43:36 +02:00
parent 3295203a66
commit 1db512092f
2 changed files with 7 additions and 3 deletions

View File

@ -495,7 +495,7 @@ class ir_fields_converter(orm.Model):
return value, []
def _html_from_many2one(self, cr, uid, model, column, value, context=None):
return werkzeug.utils.escape(value.name_get()[0][1]), []
return werkzeug.utils.escape(value.name_get()[0][1]).replace('\n', '<br>\n'), []
def _html_from_binary(self, cr, uid, model, column, value, context=None):
try:

View File

@ -210,6 +210,7 @@ class res_partner(osv.osv, format_address):
def _display_name_compute(self, cr, uid, ids, name, args, context=None):
context = dict(context or {})
context.pop('show_address', None)
context.pop('show_address_only', None)
return dict(self.name_get(cr, uid, ids, context=context))
# indirections to avoid passing a copy of the overridable method when declaring the function field
@ -546,13 +547,16 @@ class res_partner(osv.osv, format_address):
name = record.name
if record.parent_id and not record.is_company:
name = "%s, %s" % (record.parent_id.name, name)
if context.get('show_address_only'):
name = self._display_address(cr, uid, record, without_company=True, context=context)
if context.get('show_address'):
name = name + "\n" + self._display_address(cr, uid, record, without_company=True, context=context)
name = name.replace('\n\n','\n')
name = name.replace('\n\n','\n')
name = name.replace('\n\n','\n')
name = name.replace('\n\n','\n')
if context.get('show_email') and record.email:
name = "%s <%s>" % (name, record.email)
res.append((record.id, name))
print '*', res, context
return res
def _parse_partner_name(self, text, context=None):