Browse Source

[FIX] IntegrityError: column "lastname" contains null values

when creating or copying users
pull/14/head
Lorenzo Battistini 11 years ago
parent
commit
94979df572
  1. 3
      partner_firstname/partner.py

3
partner_firstname/partner.py

@ -99,7 +99,8 @@ class ResPartner(orm.Model):
to_use = vals
if 'name' in vals:
corr_vals = vals.copy()
corr_vals['lastname'] = corr_vals['name']
if vals.get('name'):
corr_vals['lastname'] = corr_vals['name']
del(corr_vals['name'])
to_use = corr_vals
return super(ResPartner, self).create(cursor, uid, to_use, context=context)

Loading…
Cancel
Save