[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user