From 88ef8a1bde75bb0a0ef918d7524db7337d5bb03b Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 24 Nov 2017 16:00:54 +0100 Subject: [PATCH] [FIX] website_sale: better address management portal Before this commit, when editing the shipping id of a partner having a company_id, an Error 500 was thrown because of recursive hierarchies. On top of that, since no employees should be able to modify its company's address, we hide the dit button in that case BUT we display addresses type=other (the one that a child of a company has anyway) meaning that the billing address appears also as a shipping one. OPW 782524 --- addons/website_sale/controllers/main.py | 2 +- addons/website_sale/views/templates.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 81053c2ac82..eceb6a731c0 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -425,7 +425,7 @@ class WebsiteSale(http.Controller): Partner = order.partner_id.with_context(show_address=1).sudo() shippings = Partner.search([ ("id", "child_of", order.partner_id.commercial_partner_id.ids), - '|', ("type", "=", "delivery"), ("id", "=", order.partner_id.commercial_partner_id.id) + '|', ("type", "in", ["delivery", "other"]), ("id", "=", order.partner_id.commercial_partner_id.id) ], order='id desc') if shippings: if kw.get('partner_id') or 'use_billing' in kw: diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 170fbd534e5..d3083ea3c84 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -1089,6 +1089,7 @@
+ @@ -1122,7 +1123,7 @@ - +