[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:
Nicolas Martinelli
2019-01-16 07:51:53 +00:00
parent ae6545ccd5
commit b876cb397d
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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')
+3 -3
View File
@@ -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"/>