Browse Source

[FIX] removed space if only first name or last name

pull/2/head
Matthieu Dietrich 11 years ago
parent
commit
3f9a565e8f
  1. 4
      firstname_display_name_trigger/res_partner.py

4
firstname_display_name_trigger/res_partner.py

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

Loading…
Cancel
Save