Skip to content

Commit

Permalink
Fix user form with firstname and lastname asking for a mandatory name
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher committed Feb 18, 2016
1 parent e357549 commit 26e2b71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions partner_firstname/models/res_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ def default_get(self, fields_list):
result[field] = inverted.get(field)

return result

@api.one
@api.onchange("firstname", "lastname")
def _compute_name(self):
"""Write the 'name' field according to splitted data."""
self.name = self.partner_id._get_computed_name(
self.lastname, self.firstname)

0 comments on commit 26e2b71

Please sign in to comment.