website.page = old ir.ui.view with page=True
website.redirect is a new mechanism to replace in the futur the ir.attachment
mechanism of redirect.
From now, we don't have a specific /page controller to serve 'page'.
We use a new model website.page which is rendered if none route matches the url
and that the field 'url' on website.page matches the request.httprequest.path.
The order to serve a path is:
- Routes defines in controllers (/shop, /blog, ...)
- ir.attachment with name matching the path
- website.page with url matching the path
- website.redirect with url_from matching the path
- 404
To improve:
- allow regexp in website.redirect model
- allow to edit the view_arch from the page.management via redirect backend
(needed when traceback in the page, or when modifying a js/css/less/...)
34 lines
1.2 KiB
XML
34 lines
1.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
<record id="crm.model_crm_lead" model="ir.model">
|
|
<field name="website_form_default_field_id" ref="crm.field_crm_lead_description" />
|
|
<field name="website_form_access">True</field>
|
|
<field name="website_form_label">Create a lead</field>
|
|
</record>
|
|
<function model="ir.model.fields" name="formbuilder_whitelist">
|
|
<value>crm.lead</value>
|
|
<value eval="[
|
|
'contact_name',
|
|
'description',
|
|
'email_from',
|
|
'name',
|
|
'partner_name',
|
|
'phone',
|
|
]"/>
|
|
</function>
|
|
</data>
|
|
<data noupdate="1">
|
|
<record id="action_open_website" model="ir.actions.act_url">
|
|
<field name="name">Website Contact Form</field>
|
|
<field name="target">self</field>
|
|
<field name="url">/contactus</field>
|
|
</record>
|
|
|
|
<record id="base.open_menu" model="ir.actions.todo">
|
|
<field name="action_id" ref="action_open_website"/>
|
|
<field name="state">open</field>
|
|
</record>
|
|
</data>
|
|
</odoo>
|