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. 1
      partner_firstname/partner.py

1
partner_firstname/partner.py

@ -99,6 +99,7 @@ class ResPartner(orm.Model):
to_use = vals to_use = vals
if 'name' in vals: if 'name' in vals:
corr_vals = vals.copy() corr_vals = vals.copy()
if vals.get('name'):
corr_vals['lastname'] = corr_vals['name'] corr_vals['lastname'] = corr_vals['name']
del(corr_vals['name']) del(corr_vals['name'])
to_use = corr_vals to_use = corr_vals

Loading…
Cancel
Save