[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:
@@ -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(
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user