From bfb70b6b9c0afceaa145d5053ea68e1d1e08d21e Mon Sep 17 00:00:00 2001
From: "Okan SUMER (osu)"
Date: Wed, 18 Mar 2020 15:55:18 +0000
Subject: [PATCH] [IMP] website_forum: rename fields, labels, texts,...
This commit rename every "Question" references by "Post"
to make it appropriate for both forum's type (Question and Discussion)
It renames some other fields/labels to be shorter or with a
capital letter at the start.
Update demo data to add a title to answers
Part of https://github.com/odoo/odoo/pull/46634
task-2201708
---
addons/website_forum/data/forum_data.xml | 26 +++++++-------
addons/website_forum/data/forum_demo.xml | 2 ++
addons/website_forum/models/forum.py | 28 +++++++--------
.../static/src/js/tours/website_forum.js | 6 ++--
.../tests/tours/website_forum_question.js | 2 +-
addons/website_forum/views/forum.xml | 6 ++--
addons/website_forum/views/website_forum.xml | 36 +++++++++----------
.../views/website_slides_templates.xml | 2 +-
8 files changed, 55 insertions(+), 53 deletions(-)
diff --git a/addons/website_forum/data/forum_data.xml b/addons/website_forum/data/forum_data.xml
index bda7eb83e21..3000a08e72e 100644
--- a/addons/website_forum/data/forum_data.xml
+++ b/addons/website_forum/data/forum_data.xml
@@ -77,55 +77,55 @@
- duplicate post
+ Duplicate postbasic
- off-topic or not relevant
+ Off-topic or not relevantbasic
- too subjective and argumentative
+ Too subjective and argumentativebasic
- not a real post
+ Not a real postbasic
- not relevant or out dated
+ Not relevant or out datedbasic
- contains offensive or malicious remarks
+ Contains offensive or malicious remarksbasic
- spam or advertising
+ Spam or advertisingbasic
- too localized
+ Too localizedbasic
- insulting and offensive language
+ Insulting and offensive languageoffensive
- violent language
+ Violent languageoffensive
- inappropriate and unacceptable statements
+ Inappropriate and unacceptable statementsoffensive
- threatening language
+ Threatening languageoffensive
- racist and hate speech
+ Racist and hate speechoffensive
diff --git a/addons/website_forum/data/forum_demo.xml b/addons/website_forum/data/forum_demo.xml
index 2884cab5c76..041ef4c8831 100644
--- a/addons/website_forum/data/forum_demo.xml
+++ b/addons/website_forum/data/forum_demo.xml
@@ -48,6 +48,7 @@ In simple words does Odoo became CMS+ERP platform?
]]>
+ Re: How to configure alerts for employee contract expirationJust for posterity so other can see. Here are the steps to set automatic alerts on any contract.. i.e. HR Employee, or Fleet for example. I will use fleet as an example.
Step 1. As a user who has access rights to Technical Features, go to Settings --> Automated Actions. Create A new Automated Action. For the Related Document Model choose.. Contract information on a vehicle (you can also type in the actual model name.. fleet.vehicle.log.contract ) . Set the trigger date to ... Contract Expiration Date. The Next Field (Delay After Trigger Date) is a bit ridiculous. Who wants to be reminded of a contract expiration AFTER the fact? The field should say Days Before Date to Fire Action and the number should be converted to a negative. IMHO. Any way... to get a workable solution you must enter in the number in the negative. So for instance like me if you want to be warned 35 days BEFORE the expiration... put in Delay After Trigger Date.. the number -35 But the sake of testing, right now just put in -1 for 1 day before. Save the Action.
@@ -59,6 +60,7 @@ In simple words does Odoo became CMS+ERP platform?]]>
+ Re: CMS replacement for ERP and eCommerceOdoo v8 provides a web module and an e-commerce module: www.odoo.com/page/website-builder
The CMS editor in Odoo web is nice but I prefer Drupal for customization and there is a Drupal module for Odoo. I think WP is better than Odoo web too.
diff --git a/addons/website_forum/models/forum.py b/addons/website_forum/models/forum.py
index 55137df5148..4632fa1a897 100644
--- a/addons/website_forum/models/forum.py
+++ b/addons/website_forum/models/forum.py
@@ -30,9 +30,9 @@ class Forum(models.Model):
name = fields.Char('Forum Name', required=True, translate=True)
sequence = fields.Integer('Sequence', default=1)
mode = fields.Selection([
- ('questions', 'Questions'),
- ('discussions', 'Discussions')],
- string='Forum Mode', required=True, default='questions',
+ ('questions', 'Questions (1 answer)'),
+ ('discussions', 'Discussions (multiple answers)')],
+ string='Mode', required=True, default='questions',
help='Questions mode: only one answer allowed\n Discussions mode: multiple answers allowed')
privacy = fields.Selection([
('public', 'Public'),
@@ -84,10 +84,10 @@ class Forum(models.Model):
'of the forum content.')
# posts statistics
post_ids = fields.One2many('forum.post', 'forum_id', string='Posts')
- total_posts = fields.Integer('Post Count', compute='_compute_forum_statistics')
- total_views = fields.Integer('Views Count', compute='_compute_forum_statistics')
- total_answers = fields.Integer('Answers Count', compute='_compute_forum_statistics')
- total_favorites = fields.Integer('Favorites Count', compute='_compute_forum_statistics')
+ total_posts = fields.Integer('Posts', compute='_compute_forum_statistics')
+ total_views = fields.Integer('Views', compute='_compute_forum_statistics')
+ total_answers = fields.Integer('Answers', compute='_compute_forum_statistics')
+ total_favorites = fields.Integer('Favorites', compute='_compute_forum_statistics')
count_posts_waiting_validation = fields.Integer(string="Number of posts waiting for validation", compute='_compute_count_posts_waiting_validation')
count_flagged_posts = fields.Integer(string='Number of flagged posts', compute='_compute_count_flagged_posts')
# karma generation
@@ -220,8 +220,8 @@ class Post(models.Model):
content = fields.Html('Content', strip_style=True)
plain_content = fields.Text('Plain Content', compute='_get_plain_content', store=True)
tag_ids = fields.Many2many('forum.tag', 'forum_tag_rel', 'forum_id', 'forum_tag_id', string='Tags')
- state = fields.Selection([('active', 'Active'), ('pending', 'Waiting Validation'), ('close', 'Close'), ('offensive', 'Offensive'), ('flagged', 'Flagged')], string='Status', default='active')
- views = fields.Integer('Number of Views', default=0)
+ state = fields.Selection([('active', 'Active'), ('pending', 'Waiting Validation'), ('close', 'Closed'), ('offensive', 'Offensive'), ('flagged', 'Flagged')], string='Status', default='active')
+ views = fields.Integer('Views', default=0, readonly=True)
active = fields.Boolean('Active', default=True)
website_message_ids = fields.One2many(domain=lambda self: [('model', '=', self._name), ('message_type', 'in', ['email', 'comment'])])
website_id = fields.Many2one(related='forum_id.website_id', readonly=True)
@@ -229,7 +229,7 @@ class Post(models.Model):
# history
create_date = fields.Datetime('Asked on', index=True, readonly=True)
create_uid = fields.Many2one('res.users', string='Created by', index=True, readonly=True)
- write_date = fields.Datetime('Update on', index=True, readonly=True)
+ write_date = fields.Datetime('Updated on', index=True, readonly=True)
bump_date = fields.Datetime('Bumped on', readonly=True,
help="Technical field allowing to bump a question. Writing on this field will trigger "
"a write on write_date and therefore bump the post. Directly writing on write_date "
@@ -245,14 +245,14 @@ class Post(models.Model):
# favorite
favourite_ids = fields.Many2many('res.users', string='Favourite')
user_favourite = fields.Boolean('Is Favourite', compute='_get_user_favourite')
- favourite_count = fields.Integer('Favorite Count', compute='_get_favorite_count', store=True)
+ favourite_count = fields.Integer('Favorite', compute='_get_favorite_count', store=True)
# hierarchy
is_correct = fields.Boolean('Correct', help='Correct answer or answer accepted')
- parent_id = fields.Many2one('forum.post', string='Question', ondelete='cascade')
+ parent_id = fields.Many2one('forum.post', string='Question', ondelete='cascade', readonly=True)
self_reply = fields.Boolean('Reply to own question', compute='_is_self_reply', store=True)
child_ids = fields.One2many('forum.post', 'parent_id', string='Answers')
- child_count = fields.Integer('Number of answers', compute='_get_child_count', store=True)
+ child_count = fields.Integer('Answers', compute='_get_child_count', store=True)
uid_has_answered = fields.Boolean('Has Answered', compute='_get_uid_has_answered')
has_validated_answer = fields.Boolean('Is answered', compute='_get_has_validated_answer', store=True)
@@ -262,7 +262,7 @@ class Post(models.Model):
# closing
closed_reason_id = fields.Many2one('forum.post.reason', string='Reason')
- closed_uid = fields.Many2one('res.users', string='Closed by', index=True)
+ closed_uid = fields.Many2one('res.users', string='Closed by', index=True, readonly=True)
closed_date = fields.Datetime('Closed on', readonly=True)
# karma calculation and access
diff --git a/addons/website_forum/static/src/js/tours/website_forum.js b/addons/website_forum/static/src/js/tours/website_forum.js
index d3d182701d2..b8bd5c67a11 100644
--- a/addons/website_forum/static/src/js/tours/website_forum.js
+++ b/addons/website_forum/static/src/js/tours/website_forum.js
@@ -11,11 +11,11 @@ odoo.define("website_forum.tour_forum", function (require) {
}, [{
trigger: ".o_forum_ask_btn",
position: "left",
- content: _t("Ask the question in this forum by clicking on the button."),
+ content: _t("Create a new post in this forum by clicking on the button."),
}, {
trigger: "input[name=post_name]",
position: "top",
- content: _t("Give your question title."),
+ content: _t("Give your post title."),
}, {
trigger: ".note-editable p",
extra_trigger: "input[name=post_name]:not(:propValue(\"\"))",
@@ -31,7 +31,7 @@ odoo.define("website_forum.tour_forum", function (require) {
actions.auto("input[id=s2id_autogen2]");
},
}, {
- trigger: "button:contains(\"Post Your Question\")",
+ trigger: "button:contains(\"Post\")",
extra_trigger: "input[id=s2id_autogen2]:not(:propValue(\"Tags\"))",
content: _t("Click to post your question."),
position: "bottom",
diff --git a/addons/website_forum/static/tests/tours/website_forum_question.js b/addons/website_forum/static/tests/tours/website_forum_question.js
index 8457d58640f..b2f549aed83 100644
--- a/addons/website_forum/static/tests/tours/website_forum_question.js
+++ b/addons/website_forum/static/tests/tours/website_forum_question.js
@@ -26,7 +26,7 @@ odoo.define('website_forum.tour_forum_question', function (require) {
}, {
content: "Click to post your question.",
extra_trigger: "#wrap:not(:has(input[id=s2id_autogen2]:propValue('')))",
- trigger: 'button:contains("Post Your Question")',
+ trigger: 'button:contains("Post")',
}, {
content: "This page contain new created question.",
trigger: '#wrap:has(".fa-star")',
diff --git a/addons/website_forum/views/forum.xml b/addons/website_forum/views/forum.xml
index 45c592fc831..aba1aa64c47 100644
--- a/addons/website_forum/views/forum.xml
+++ b/addons/website_forum/views/forum.xml
@@ -225,10 +225,10 @@
-
+
-
+
@@ -257,7 +257,7 @@
tree,form,graph
- {'search_default_questions':1}
+ {'search_default_posts':1}
Create a new forum post
diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml
index 7b142b0cd06..7bf8a313732 100644
--- a/addons/website_forum/views/website_forum.xml
+++ b/addons/website_forum/views/website_forum.xml
@@ -89,8 +89,8 @@
The goal of this site is create a relevant knowledge base that would answer questions related to Odoo.
Therefore questions and answers can be edited like wiki pages by experienced users of this site in order to improve the overall quality of the knowledge base content. Such privileges are granted based on user karma level: you will be able to do the same once your karma gets high enough.
-
If this approach is not for you, please respect the community and use Google+ communities instead.
+
If this approach is not for you, please respect the community.
@@ -503,13 +503,13 @@
-
+
- My Questions
+ My Posts
×
- My Questions
+ My Posts
@@ -581,7 +581,7 @@
My Favourites I'm Following
- My Questions
+ My PostsTags I Follow×
@@ -597,9 +597,9 @@
@@ -700,7 +700,7 @@
in your favouritesin your followed list
- in your questions
+ in your postsmatching "" and
@@ -721,7 +721,7 @@
No favourite questions in this forum (yet). Browse All
-
You have no questions in this forum (yet).
+
You have no posts in this forum (yet).
Amazing! There are no unanswered questions left!
@@ -770,7 +770,7 @@
+ class="form-control form-control-lg" placeholder="A clear, explicit and concise title" title="Title must not be empty"/>
- Good morning to all! Please, can someone help solve solve my tax computation problem in Canada? Thanks!
+ Good morning to all! Please, can someone help solve my tax computation problem in Canada? Thanks!
@@ -830,12 +830,12 @@
-
Use a clear, explicit and concise question title
+
Use a clear, explicit and concise title
How to configure TPS and TVQ's canadian taxes?
- Good morning to all! Please, can someone help solve solve my tax computation problem in Canada? Thanks!
+ Good morning to all! Please, can someone help solve my tax computation problem in Canada? Thanks!
diff --git a/addons/website_slides_forum/views/website_slides_templates.xml b/addons/website_slides_forum/views/website_slides_templates.xml
index ea17a3b88b2..09971c6fe55 100644
--- a/addons/website_slides_forum/views/website_slides_templates.xml
+++ b/addons/website_slides_forum/views/website_slides_templates.xml
@@ -20,7 +20,7 @@
- Ask a question
+ New Post