Compare commits

..

No commits in common. "dc05cf3ff1849a4f638e1c3bf79742b5480ec978" and "2165dac60398ffd3104a67439eabb8af97fa70a2" have entirely different histories.

2 changed files with 2 additions and 14 deletions

View File

@ -53,20 +53,8 @@ class EventRentalController(http.Controller):
}
return request.render('event_rental.rental_catalog_template', values)
@http.route('/rentals/<string:product_slug>', type='http', auth='public', website=True)
def rental_product_detail(self, product_slug, **post):
try:
if '-' in product_slug:
product_id = int(product_slug.split('-')[-1])
else:
product_id = int(product_slug)
except (ValueError, IndexError):
return request.not_found()
product = request.env['product.template'].sudo().browse(product_id)
if not product or not product.exists() or not product.is_rental:
return request.not_found()
@http.route('/rentals/<model("product.template"):product>', type='http', auth='public', website=True)
def rental_product_detail(self, product, **post):
return request.render('event_rental.rental_product_detail_template', {'product': product})
@http.route('/rental/request', type='http', auth='public', website=True, methods=['GET', 'POST'])