From 096c207241bcfc85b29274aac3e3eb34f26e02dc Mon Sep 17 00:00:00 2001 From: imanie383 Date: Mon, 25 Apr 2022 18:39:35 +0000 Subject: [PATCH] [FIX] website_sale: address edit error The value of _checkout_form_save was validated because in some cases the method returns Forbidden() and this value is set directly to the order closes odoo/odoo#89786 X-original-commit: 860370f5ed03e2fdc801ddbe02115818bb251655 Signed-off-by: William Braeckman (wbr) --- addons/website_sale/controllers/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 7f8415f1608..073d368c0f3 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -842,6 +842,10 @@ class WebsiteSale(http.Controller): values = kw else: partner_id = self._checkout_form_save(mode, post, kw) + # We need to validate _checkout_form_save return, because when partner_id not in shippings + # it returns Forbidden() instead the partner_id + if isinstance(partner_id, Forbidden): + return partner_id if mode[1] == 'billing': order.partner_id = partner_id # This is the *only* thing that the front end user will see/edit anyway when choosing billing address