[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) <wbr@odoo.com>
This commit is contained in:
imanie383
2022-04-27 09:00:39 +02:00
parent 73a6cbfa68
commit 096c207241
+4
View File
@@ -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