[FIX] website: null type redirection
Commit 68e9d5504c makes the redirection type mandatory, which is
logical. Since we can't add such a constraint in stable, we make the
field required in the view and assign a default value (in case the
module is not upgraded, which is very likely to be the case).
opw-1924983
closes odoo/odoo#30252
This commit is contained in:
@@ -910,7 +910,7 @@ class WebsiteRedirect(models.Model):
|
||||
_order = "sequence, id"
|
||||
_rec_name = 'url_from'
|
||||
|
||||
type = fields.Selection([('301', 'Moved permanently'), ('302', 'Moved temporarily')], string='Redirection Type')
|
||||
type = fields.Selection([('301', 'Moved permanently'), ('302', 'Moved temporarily')], string='Redirection Type', default='301')
|
||||
url_from = fields.Char('Redirect From')
|
||||
url_to = fields.Char('Redirect To')
|
||||
website_id = fields.Many2one('website', 'Website')
|
||||
|
||||
@@ -70,9 +70,9 @@
|
||||
<sheet>
|
||||
<group>
|
||||
<group>
|
||||
<field name="type"/>
|
||||
<field name="url_from"/>
|
||||
<field name="url_to"/>
|
||||
<field name="type" required="1"/>
|
||||
<field name="url_from" required="1"/>
|
||||
<field name="url_to" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="website_id"/>
|
||||
|
||||
Reference in New Issue
Block a user