From c41d1d2ca8e6a1cacf6b28c71bd6ff934728c827 Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Thu, 14 Mar 2019 12:46:01 +0000 Subject: [PATCH] [FIX] website_event: pricelist in event register Create an event with a price. Create a pricelist with a different price for the event. Add the pricelist to the Public user. On the website, open the event to register. Before this commit, the shown price is the one of the event, and not the one of the pricelist. Now, the price is shown correctly and take into account the pricelist. opw-1951252 closes odoo/odoo#31848 Signed-off-by: Nicolas Martinelli (nim) --- addons/website_event/controllers/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index acff56f9321..9e86e2ddeba 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -181,7 +181,10 @@ class WebsiteEventController(http.Controller): def event_register(self, event, **post): if not event.can_access_from_current_website(): raise werkzeug.exceptions.NotFound() - + if not request.context.get('pricelist'): + pricelist = request.website.get_current_pricelist() + if pricelist: + event = event.with_context(pricelist=pricelist.id) values = { 'event': event, 'main_object': event,