Hi,
I installed 'website' module
then in my module "fleet_rental" , created a controller folder with two files, fleet_web.py and _init_.py
In _init_.py, I wrote like this:
import fleet_web
In fleet_web.py, I wrote like this:
from odoo import http
class FleetWeb(http.Controller):
@http.route('/fleet_web/', type='http', auth='public', website=True)
def render_reservation_page(self):
return http.request.render('fleet_rental.reservation_page', {})
Then I created an xml file , views/reservation_webpage.xml where I wrote:
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<template id="reservation_page" name="Online Reservation page" page="True">
<t t-call="website.layout">
<div class="oe_structure">
<div class="container">
<center><h3>Title</h3></center>
<p>
You can add all your content here.<br/>
<a t-attf-href="/fleet_web/detail" class="btn btn-info">Online Booking</a>
</p>
</div>
</div>
</t>
</template>
</data>
</odoo>
Then i updated the module and in website if I give http://localhost:8069/fleet_web
I am getting following error:
404: Page not found!
The page you were looking for could not be found; it is possible you have typed the address incorrectly, but it has most probably been removed due to the recent website reorganisation.
Maybe you were looking for one of these popular pages ?
Please help and tell me If I went wrong anywhere or I have to do anything else
check if you have imported your controller folder in __init__.py of the module and defined xml file in manifest file
Yes I did both.