Skip to content
Snippets Groups Projects
Commit cdd7ab7f authored by Joren Van Onder's avatar Joren Van Onder Committed by Antony Lesuisse
Browse files

[FIX] website_event_sale: don't use registry cache for default ticket

Before this request.registry.get('ir.model.data').get_object_reference()
was used to grab the event_sale.product_product_event record. After
deletion of this product get_object_reference() would still return the
old id, which upon usage would throw a MissingError exception.

So to fix this, bypass the registry caches by using just
request.env.ref().
parent 6262ad9a
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ class website_event(website_event):
def _add_event(self, event_name="New Event", context={}, **kwargs):
try:
dummy, res_id = request.registry.get('ir.model.data').get_object_reference(request.cr, request.uid, 'event_sale', 'product_product_event')
res_id = request.env.ref('event_sale.product_product_event').id
context['default_event_ticket_ids'] = [[0, 0, {
'name': _('Subscription'),
'product_id': res_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment