[IMP] website_forum: add sequences

When you had several forums, they were displayed according to the
creation order. Now, you can define a sequence on them and order forums.

task-2007173

closes odoo/odoo#34184

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Andrea Ulliana
2019-06-17 11:02:38 +00:00
parent e05442fe19
commit 3ab5612e4f
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -20,6 +20,7 @@ class Forum(models.Model):
_name = 'forum.forum'
_description = 'Forum'
_inherit = ['mail.thread', 'image.mixin', 'website.seo.metadata', 'website.multi.mixin']
_order = "sequence"
@api.model
def _get_default_faq(self):
@@ -28,6 +29,7 @@ class Forum(models.Model):
# description and use
name = fields.Char('Forum Name', required=True, translate=True)
sequence = fields.Integer('Sequence', default=1)
active = fields.Boolean(default=True)
faq = fields.Html('Guidelines', default=_get_default_faq, translate=html_translate, sanitize=False)
description = fields.Text(
+1
View File
@@ -14,6 +14,7 @@
<field name="model">forum.forum</field>
<field name="arch" type="xml">
<tree string="Forums">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="website_id" groups="website.group_multi_website"/>
<field name="active" invisible="1"/>