[FIX] website_portal: details of a contact

When changing the contact details of a partner which is a company contact,
all the fields related to the address must be set on the commercial partner.

The address displayed for a company contact is the address of the commercial
partner.

opw:686335
This commit is contained in:
Goffin Simon
2016-08-23 14:49:57 +02:00
parent fceba5df8c
commit 6d4bb4f18c
+10
View File
@@ -37,6 +37,16 @@ class website_account(http.Controller):
values.update(post)
if not error:
post.update({'zip': post.pop('zipcode', '')})
if partner.type == "contact":
address_fields = {
'city': post.pop('city'),
'street': post.pop('street'),
'street2': post.pop('street2'),
'zip': post.pop('zip'),
'country_id': post.pop('country_id'),
'state_id': post.pop('state_id')
}
partner.commercial_partner_id.write(address_fields)
partner.sudo().write(post)
if redirect:
return request.redirect(redirect)