# Eagle Estates - Addendum 2 (Portal)

We decided to add a portal to our App to allow tenants to access their quotations/invoices from Odoo's public portal. Now we need to make properties accessible from the portal as well. To achieve this, do the following:

# Mixin

  • Add a new boolean field on properties to allow them to be published on the portal.
  • Inherit the portal.mixin mixin on the properties to make them accessible from the portal.
  • Override the _compute_access_url method to make our properties accessible via the /my/properties/ URL

# Controllers

Extend the CustomerPortal class to do the following:

  • Override the _prepare_home_portal_values method to add a link to the properties list.
  • Add the following route methods to access our properties
    • portal_my_properties to list all the published properties.
    • portal_my_property to display details of a single property.

# Templates

  • Override the portal.portal_my_home template to add a link to the properties list. It should read as follows:
    • My Properties (COUNT) - A link to the /my/properties/ URL.
  • Define a template that will be rendered through the portal_my_properties route. The template should display the following details for each property:
    • Property Name
    • Construction Date
    • Property Area
    • A link to the property details page. This view should also be searchable and include options to filter/group by construction date and property area.
  • Define a template that will be rendered through the portal_my_property route. The template should display for any given property. It should inherit portal.portal_sidebar and be primary