[IMP] website: make website.redirect fields required
Before this commit, it was possible to create redirect with empty values.
Now, for new db, that will be required.
Fix usability according to first feedback
- Redirect / menu should be visible without debug mode
because user need it when they start their website and
dont know at the beginning how to enable it (fgi)
- fa icon in page manager was for blind people
- missing widget on sequence field
This commit is contained in:
@@ -891,9 +891,9 @@ class WebsiteRedirect(models.Model):
|
||||
_order = "sequence, id"
|
||||
_rec_name = 'url_from'
|
||||
|
||||
type = fields.Selection([('301', 'Moved permanently'), ('302', 'Moved temporarily')], string='Redirection Type')
|
||||
url_from = fields.Char('Redirect From')
|
||||
url_to = fields.Char('Redirect To')
|
||||
type = fields.Selection([('301', 'Moved permanently (301)'), ('302', 'Moved temporarily (302)')], string='Redirection Type', required=True)
|
||||
url_from = fields.Char('Redirect From', required=True)
|
||||
url_to = fields.Char('Redirect To', required=True)
|
||||
website_id = fields.Many2one('website', 'Website')
|
||||
active = fields.Boolean(default=True)
|
||||
sequence = fields.Integer(default=0)
|
||||
sequence = fields.Integer()
|
||||
|
||||
@@ -219,14 +219,14 @@
|
||||
action="action_website_pages_list"
|
||||
parent="menu_website_global_configuration"
|
||||
sequence="20"
|
||||
groups="base.group_no_one"/>
|
||||
/>
|
||||
|
||||
<menuitem name="Redirects"
|
||||
id="menu_website_redirect_list"
|
||||
action="action_website_redirect_list"
|
||||
parent="menu_website_global_configuration"
|
||||
sequence="30"
|
||||
groups="base.group_no_one"/>
|
||||
/>
|
||||
|
||||
<menuitem name="Menus"
|
||||
id="menu_website_menu_list"
|
||||
|
||||
@@ -939,10 +939,10 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||||
<td class="text-center"><i t-att-title="not page.is_visible and page.website_published and 'This page will be visible on ' + date_formatted" t-att-class="'fa fa-check' if page.is_visible and page.website_published else 'fa fa-eye-slash' if not page.is_visible and page.website_published else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td class="text-center"><i t-att-class="'fa fa-check' if page.website_indexed else 'fa fa-times text-muted'" aria-hidden="true"></i></td>
|
||||
<td class="text-right">
|
||||
<a class="mr4 fa fa-lg fa-cog js_page_properties" t-att-data-id="page.id" href="#" title="Manage this page"></a>
|
||||
<a class="mr4 fa fa-lg fa-pencil-square-o" t-attf-href="/web#id=#{page.view_id.id}&view_type=form&model=ir.ui.view" title="Edit code in backend"></a>
|
||||
<a class="mr4 fa fa-lg fa-clone js_clone_page" t-att-data-id="page.id" href="#" title="Clone this page"></a>
|
||||
<a class="fa fa-lg fa-trash js_delete_page" t-att-data-id="page.id" href="#" title="Delete this page"></a>
|
||||
<a class="mr4 fa fa-cog js_page_properties" t-att-data-id="page.id" href="#" title="Manage this page"></a>
|
||||
<a class="mr4 fa fa-pencil-square-o" t-attf-href="/web#id=#{page.view_id.id}&view_type=form&model=ir.ui.view" title="Edit code in backend"></a>
|
||||
<a class="mr4 fa fa-clone js_clone_page" t-att-data-id="page.id" href="#" title="Clone this page"></a>
|
||||
<a class="fa fa-trash js_delete_page" t-att-data-id="page.id" href="#" title="Delete this page"></a>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
|
||||
@@ -61,6 +61,22 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_redirect_search" model="ir.ui.view">
|
||||
<field name="name">website.redirect.search</field>
|
||||
<field name="model">website.redirect</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Redirect">
|
||||
<field name="url_from"/>
|
||||
<field name="url_to"/>
|
||||
|
||||
<group string="Group By">
|
||||
<filter string="Redirection Type" name="group_by_type" domain="[]" context="{'group_by': 'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- website.redirect views -->
|
||||
<record id="website_redirect_form_view" model="ir.ui.view">
|
||||
<field name="name">website.redirect.form</field>
|
||||
@@ -77,7 +93,6 @@
|
||||
<group>
|
||||
<field name="website_id"/>
|
||||
<field name="active"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
@@ -89,13 +104,13 @@
|
||||
<field name="name">website.redirect.list</field>
|
||||
<field name="model">website.redirect</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Website Redirects">
|
||||
<tree string="Website Redirects" editable="bottom">
|
||||
<field name="type"/>
|
||||
<field name="url_from"/>
|
||||
<field name="url_to"/>
|
||||
<field name="website_id"/>
|
||||
<field name="active"/>
|
||||
<field name="sequence"/>
|
||||
<field name="sequence" widget="handle" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -107,6 +122,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="website_redirect_tree_view"/>
|
||||
<field name="target">current</field>
|
||||
<field name="search_view_id" ref="view_redirect_search"/>
|
||||
</record>
|
||||
|
||||
<!-- website.page views -->
|
||||
|
||||
Reference in New Issue
Block a user