[FIX] event: subscribe customer error
The onchange methods needs to work with browse records and address_get returns an id. Fixes #2484
This commit is contained in:
parent
e6a2d222d6
commit
e31d25c867
|
@ -380,8 +380,9 @@ class event_registration(models.Model):
|
||||||
@api.onchange('partner_id')
|
@api.onchange('partner_id')
|
||||||
def _onchange_partner(self):
|
def _onchange_partner(self):
|
||||||
if self.partner_id:
|
if self.partner_id:
|
||||||
contact = self.partner_id.address_get().get('default', False)
|
contact_id = self.partner_id.address_get().get('default', False)
|
||||||
if contact:
|
if contact_id:
|
||||||
|
contact = self.env['res.partner'].browse(contact_id)
|
||||||
self.name = contact.name
|
self.name = contact.name
|
||||||
self.email = contact.email
|
self.email = contact.email
|
||||||
self.phone = contact.phone
|
self.phone = contact.phone
|
||||||
|
|
Loading…
Reference in New Issue