diff --git a/addons/website_forum/models/forum_forum.py b/addons/website_forum/models/forum_forum.py index 3a58afcc605..42c157e6258 100644 --- a/addons/website_forum/models/forum_forum.py +++ b/addons/website_forum/models/forum_forum.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models +from odoo import _, api, fields, models from odoo.tools.translate import html_translate from odoo.addons.http_routing.models.ir_http import slug @@ -18,6 +18,27 @@ class Forum(models.Model): ] _order = "sequence" + def _get_default_welcome_message(self): + return """ +
+
+
+
+

Welcome!

+

%(message_intro)s
%(message_post)s

+
+ +
+
+
""" % { + 'message_intro': _("This community is for professionals and enthusiasts of our products and services."), + 'message_post': _("Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together."), + 'hide_text': _('Hide Intro'), + 'register_text': _('Register')} + # description and use name = fields.Char('Forum Name', required=True, translate=True) sequence = fields.Integer('Sequence', default=1) @@ -41,27 +62,9 @@ class Forum(models.Model): description = fields.Text('Description', translate=True) teaser = fields.Text('Teaser', compute='_compute_teaser', store=True) welcome_message = fields.Html( - 'Welcome Message', - translate=True, - default="""
-
-
-
-

Welcome!

-

- This community is for professionals and enthusiasts of our products and services. -
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together. -

-
- -
-
-
""", - sanitize_attributes=False, - sanitize_form=False) + 'Welcome Message', translate=html_translate, + default=_get_default_welcome_message, + sanitize_attributes=False, sanitize_form=False) default_order = fields.Selection([ ('create_date desc', 'Newest'), ('write_date desc', 'Last Updated'),