Skip to content
Permalink
Browse files

[FIX] website_event,website_event_sale: correction pricelist in event…

… register

A recent fix c41d1d2 was made to select the related pricelist
to show the correct price of an event product.

This fix creates another bug in case of Ecommerce app
not installed, because the method get_current_pricelist
is defined in website_sale module.

We need to move the fix from website_event to website_event_sale module.
  • Loading branch information...
alt-odoo committed Mar 19, 2019
1 parent 82c4393 commit da798d8de89eb84819f89a9f52919aa5dea53057
Showing with 5 additions and 4 deletions.
  1. +1 −4 addons/website_event/controllers/main.py
  2. +4 −0 addons/website_event_sale/controllers/main.py
@@ -181,10 +181,7 @@ def event(self, event, **post):
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,
@@ -11,6 +11,10 @@ class WebsiteEventSaleController(WebsiteEventController):
@http.route()
def event_register(self, event, **post):
event = event.with_context(pricelist=request.website.id)
if not request.context.get('pricelist'):
pricelist = request.website.get_current_pricelist()
if pricelist:
event = event.with_context(pricelist=pricelist.id)
return super(WebsiteEventSaleController, self).event_register(event, **post)

def _process_tickets_details(self, data):

0 comments on commit da798d8

Please sign in to comment.
You can’t perform that action at this time.