Managing dynamic routes
In website development projects, it is often the case that we need to create pages with dynamic URLs. For example, in e-commerce, each product has a detailed page linked with a different URL. In this recipe, we will create a web page to display hostel details.
Getting ready
Add basic fields in the hostel
model:
from odoo import fields, models class Hostel(models.Model): Â Â Â _name = 'hostel.hostel' Â Â Â _description = "Information about hostel" Â Â Â _order = "id desc, name" Â Â Â _rec_name = 'hostel_code' Â Â Â name = fields.Char(string="hostel Name", required=True) Â Â Â hostel_code = fields.Char(string="Code", required=True) Â Â Â street = fields.Char('Street') Â Â Â street2 = fields.Char('Street2') Â Â Â zip = fields.Char('Zip', change_default=True...