Browse Source

[FIX] firstname lastname fix if empty

pull/2/head
Vincent Renaville 12 years ago
parent
commit
8fde69d726
  1. 2
      partner_firstname/partner.py

2
partner_firstname/partner.py

@ -33,7 +33,7 @@ class ResPartner(Model):
def _compute_name_custom(self, cursor, uid, ids, fname, arg, context=None): def _compute_name_custom(self, cursor, uid, ids, fname, arg, context=None):
res = {} res = {}
for rec in self.read(cursor, uid, ids, ['firstname', 'lastname']): for rec in self.read(cursor, uid, ids, ['firstname', 'lastname']):
name = rec['lastname'] + (u" " + rec['firstname'] if rec['firstname'] else u"")
name = rec['lastname'] if rec['lastname'] else u"" + (u" " + rec['firstname'] if rec['firstname'] else u"")
res[rec['id']] = name res[rec['id']] = name
return res return res

Loading…
Cancel
Save