From 49fdd155f752fb36db46e972fa87aff39860758f Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Mon, 29 Apr 2019 14:20:27 +0000 Subject: [PATCH] [FIX] website_sale: handle free SO When a sale order is free, no transaction are created but you are redirected to the page '/shop/confirmation' that display a transaction and lead to bad displaying because there are no transaction. To fix this behaviour, we redirect to the portal view of this sale order. We've also added the 'href=#' on the button link to have it written in white. closes odoo/odoo#33019 Signed-off-by: pimodoo --- addons/website_sale/controllers/main.py | 3 +++ addons/website_sale/views/templates.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index ae79e8a141f..3411fb3e3b9 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -969,6 +969,9 @@ class WebsiteSale(ProductConfiguratorController): if not order or (order.amount_total and not tx): return request.redirect('/shop') + if order and not order.amount_total and not tx: + return request.redirect(order.get_portal_url()) + # clean context and session, then redirect to the confirmation page request.website.sale_reset() if tx and tx.state == 'draft': diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index e9ed17c7f52..5b89ad4982b 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -1364,7 +1364,7 @@