Files
odoo_source/addons/website/models/__init__.py
T
198e226f5b [IMP] website: Expose models on the website
This commit implements a way to expose any model publicly on the website. Both manual and
existing models can create such pages called 'Model Pages'.
A manual model is a model that has been created by the user at runtime, via the technical menu,
via studio, or with an xml declaration.

The main interface to easily create such page is in Studio, in the tab Website Integration. But a
partner or developer could easily import those without studio installed. That's the reason most of
the code to handle the display of such pages is present in the website module directly.

The listing can handle two display modes (Grid or List). Once the user changes the display mode,
the latest value is set in the session to be remembered for the next visit of the page.
A default_layout can be set and is customizable in the website editor or from the backend of Website.
This value is linked to the page to display, so each listing page can use a different layout by default.

The route on which the models are exposed is:
"/model/<string:page_name_slugified>",

With the derived routes:
"/model/<string:page_name_slugified>/page/<int:page_number>",
"/model/<string:page_name_slugified>/<string:record_slug>"

task-id-3231144

Part-of: odoo/odoo#130544
Co-authored-by: Florent Dardenne (dafl) <dafl@odoo.com>
Co-authored-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-10-26 12:10:08 +00:00

35 lines
950 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import assets
from . import base_partner_merge
from . import ir_actions_server
from . import ir_asset
from . import ir_attachment
from . import ir_binary
from . import ir_http
from . import ir_model
from . import ir_model_data
from . import ir_module_module
from . import ir_qweb
from . import ir_qweb_fields
from . import mixins
from . import website
from . import website_menu
from . import website_page
from . import website_rewrite
from . import ir_rule
from . import ir_ui_menu
from . import ir_ui_view
from . import res_company
from . import res_partner
from . import res_users
from . import res_config_settings
from . import res_lang
from . import theme_models
from . import website_configurator_feature
from . import website_form
from . import website_snippet_filter
from . import website_visitor
from . import website_controller_page