Browse Source

[FIX] firstname_display_name_trigger: remove trailing space from display name if only the lastname is defined

pull/2/head
unknown 11 years ago
committed by Pedro M. Baeza
parent
commit
e1368aff4e
  1. 4
      firstname_display_name_trigger/res_partner.py

4
firstname_display_name_trigger/res_partner.py

@ -37,8 +37,8 @@ class ResPartner(orm.Model):
ids = [ids]
res = []
for record in self.browse(cr, uid, ids, context=context):
name = '%s %s'%(record.lastname if record.lastname else u"",
record.firstname if record.firstname else u"")
names = (record.lastname, record.firstname)
name = u" ".join([s for s in names if s])
if record.parent_id and not record.is_company:
name = "%s, %s" % (record.parent_id.name, name)
if context.get('show_address'):

Loading…
Cancel
Save