Skip to content
Snippets Groups Projects
Commit e31d25c8 authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] event: subscribe customer error

The onchange methods needs to work with browse records and address_get returns an id. Fixes #2484
parent e6a2d222
No related branches found
No related tags found
No related merge requests found
......@@ -380,8 +380,9 @@ class event_registration(models.Model):
@api.onchange('partner_id')
def _onchange_partner(self):
if self.partner_id:
contact = self.partner_id.address_get().get('default', False)
if contact:
contact_id = self.partner_id.address_get().get('default', False)
if contact_id:
contact = self.env['res.partner'].browse(contact_id)
self.name = contact.name
self.email = contact.email
self.phone = contact.phone
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment