From 6d4bb4f18c8820bd9115bbcfe1a4b0337585b991 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 22 Aug 2016 13:39:43 +0200 Subject: [PATCH] [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 --- addons/website_portal/controllers/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/website_portal/controllers/main.py b/addons/website_portal/controllers/main.py index dc900002be7..cf8e818fc3b 100644 --- a/addons/website_portal/controllers/main.py +++ b/addons/website_portal/controllers/main.py @@ -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)