Now, once the question is flagged, we show two options for it: 'Validate' and
'Mark as Offensive'.
So, one can directly validate (or not) directly from the question page.
task-2167561
Part-of: odoo/odoo#45352
Co-authored-by: jpr-odoo <jpr@openerp.com>
(*: website_blog, website_event, website_forum, website_sale,
website_slides)
Before this commit the search bar was specific to products.
After this commit a generic search bar is available as a general feature
of website which can be configured to inspect specific models.
The snippet is used to replace the old search bar in blog, courses,
event, forum, page and shop.
The search results of these pages and the autocomplete of the search bar
run through the same search mechanism.
A new hybrid results page has also been created as a target of a search
on "Everything".
In each involved module, `website._search_get_details()` is implemented
to return search metadata for every model related to the `search_type`
parameter.
Search metadata for a single model is returned by `_search_get_detail()`
on that specific model.
The autocomplete runs through the additional
`website._search_render_results()` pre-rendering step that prepares the
data to fit in the autocomplete template.
task-2379555
https://github.com/odoo/odoo/pull/65871
Part-of: odoo/odoo#65871
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.
We removed redirect_with_hash that was only for retro compatibility
local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.
Default code for redirect is 303 now instead of 302.
Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.
All werkeug.utils.redirect has been replaced by request.redirect.
Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.
Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.
Migrate your code:
http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect
Courtesy of odony for help and review ;)
closesodoo/odoo#72599
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, routes were prevented to be accessed if the route model was
not accessible from the current website, eg you couldn't access blog1 which is
set to website2 from website 1.
That would raise a 404 even from admin/editor.
This commit introduce that behavior at a lowel level in a generic way, instead
of having to write it on every route.
Note that routes without a model converter won't benefit from this.
Closes#63499closesodoo/odoo#64313
Related: odoo/enterprise#15688
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
in this commit, when activated 'Show # found' option in Customize menu,
the count of searched records for the manage your pages, event, and form page
displayed on the search button(#found).
task-2115526
closesodoo/odoo#40121
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the parameter for user filters was not kept in the
url when navigating with the pager.
Closes https://github.com/odoo/odoo/issues/56248closesodoo/odoo#61093
X-original-commit: c6a8be30c2b43d6462e365da6f3ec5aad32d1c08
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*blog, forum, slides
Based on https://github.com/odoo/odoo/pull/48552#discussion_r440061218 suggestion
Add a new method 'increment_skip_lock' in tools.sql to allow to easily
increment a specific field of 1 if the record is not locked.
The method return boolean if at least 1 record has been incremented.
closesodoo/odoo#58765
X-original-commit: d92e61e89f468c2db2fbd68b2f0d6b36c77f1065
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Purpose of the retro-compatibility route was to redirect the old to the new.
And not redirect to themself and create a loop
closesodoo/odoo#58672
X-original-commit: b5e1bafeb42e94b587c245e9e7aa844770a129c6
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Url for a product become:
/shop/productname-id instead of /shop/product/productname-id
Url for a blog post become:
/blog/blogname-1/blogpost-1 instead of /blog/blogname-1/post/blogpost-1
Url for a question on forum become:
/forum/forumname-1/title-1 instead of /forum/forumname-1/question/title-1
task-2295016
Try to make the update the latest possible, to minimize risk of concurrent
update.
Since it is not critical to loose a view, add the old value in where clause, to
try to decrease the risk to alter at the same time a same row.
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
of a custom one for the first 3 elements, the last one is on a
new page accessible from a link below the accordion
- Cut the description after a specific amount of characters in the
page where all forum are listed
- In that same view, create options that show the number of post
and the last post a forum has. Create an option to render forums
in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications
Part of https://github.com/odoo/odoo/pull/46634
task-2201708
Currently posts are hidden at the post level only (by giving a 404).
The posts are still visible in the list of posts on the main forum page.
Now we hide the posts of users with negative amount of karma.
task-2093636
closesodoo/odoo#46194
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- A tag has been added next to the title of each tab in the profile when the user come from a specific forum. The goal is to indicate to the user that the displayed content is specific to a given forum. The tag can be clicked by the user to remove the applied filter.
- Change label in edit profile page from "real name" to "name"
Task Id: 2214425
closesodoo/odoo#48665
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Issue
- Install Forums
- Create a post (name = test)
- Add an answer
- Check your profile > answers
You have an answer named "Re: test"
- Edit the answer
- Check again
"Re: test" disappeared, it's a blank line now
Cause
When editing the answer, we do not pass a name
So if we do name = kwargs.get('name') => None
Solution
Pass the name to the vals if it exists
OPW-2227418
closesodoo/odoo#48970
X-original-commit: c53f1c6a58b4c8c9e9b3c87f27281c9bfd65a0e1
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Add privacy on forum: public or private. If private, we must select
one group that has access.
For forum linked to eLearning course: the privacy of forum is the same
as the course. If the course is not yet published, the forum will be
invisible (unless we have the group group_website_slides_officer).
If a forum linked to a course is unlinked or removed, the forum will
become private and his group will be set to group_website_slides_officer.
All posts and tags have the same access rules as their linked forum.
closesodoo/odoo#43486
Taskid: 2169965
Related: odoo/upgrade#758
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Issue
- Install Forums
- Have at least 2 forums
- Go in one of them
- Go in a topic
- Click the button "All Forums" to go back
- You go back to the forum's app homepage
This is bad for UX, I should have been redirected
to the forum's topic list.
Cause
This behavior is not handled by Odoo.
Solution
Move All Forums in the navbar
Creating a smart "back" button based on browser history.
OPW-2198011
closesodoo/odoo#46454
X-original-commit: 307e6cd5b44b8f619a35056557f72aae241943b3
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Every records created from frontend should have the website_id set to the
current website.
Most was done with 066cfc9598, but forum was missing it.
Fixes#45749closesodoo/odoo#46126
X-original-commit: 08540d7853d497e326182e822b359cd6fcb05d59
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
* website_blog, website_event_track, website_forum, website_mail_channel
7dd70438e1 was introduced in stable as a fix, which obviously had some stable
policy preventing some changes.
This commit improves that commit in master.
task-2119086
closesodoo/odoo#45622
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
PURPOSE
Clean posting process and improve mail.message definition and comprehension.
SPECIFICATIONS
In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !
LINKS
Task ID 2071556
PR #38692
Steps to reproduce the bug:
- Ask a question in the forum with a title but with no content
Bug:
A traceback was raised.
opw:2093665
closesodoo/odoo#39675
X-original-commit: 51f660c9a66f2e6aecb51e476d815b2f083f843d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
From now, you need to explicitely add sitemap=True if you want your controller
into the sitemap.
It's the default value, but if you forgot it, it will raise a Warning on runbot.
It will avoid wrong controller in sitemap and duplicate (empty) content.
From now, if your model contains a field website_id, the modelConverter for
sitemap will automatically add the domain:
"[('website_id', 'in', (False, current_website_id))]"
It avoid redundant declaration and ugly url in redirect/rewrite view.
Migration: need to remove it from url_from in website.rewrite
task-2065018
closesodoo/odoo#39427
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*base, website_blog, website_event, website_forum, website_slides
With this commit:
1. It is now possible to add the 'Edit in backend' entry in the frontend navbar
for any desired model, not only the ones which have the published mixin.
It will simply redirect to the main_object form view.
This commit add it to Forum and Blog.
2. When clicking on 'Edit in backend', it is now possible to land on another
module than Website.
That's especially useful for events and slides which are not directly
related to the website module as they have their own module.
3. Remove the custom Edit in backend from the forum homepage (fa-cog).
Opportunity was also taken to remove the 'edit welcome message'.
It will now be editable through the editor (welcome message will appear in
edit mode). Thus we got rid of the custom edit welcome message controller
and views.
Closes#36325
It is now possible to specify the forum mode : Questions and Answers or
Discussions. In Q&A mode, a user can only reply once while there is no
limit in Discussions mode.
task-2008910
closesodoo/odoo#34097
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This code was not used properly and was triggering useless rpc.
This code was used in the deprecated badge system and we forgot to
remove it.
Commit where the code should have been removed:
ec212de5c7
Commit where a quick fix was made:
1e1ea00e66
- If you are a portal user when trying to access the validation queue
an access right error can be triggered when trying to read the post's
user name if the record rules don't let you read on this specific
user.
closesodoo/odoo#33626
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
Email validation was necessary on the forum to be able to begin to use the forum
(ask or answer questions, vote, etc..)
As the new elearning also uses karma since 705376a982,
the email validation is now also necessary in the eLearning platform.
This is why this commit is moving the email validation process to website_profile
and extend website_slides (eLearning) and website_forum to use this feature.
In function of where the user asked to send him the validation email,
the user is redirected on the forum or on the elearning when he clicks on
'Validate my account' in the received 'email validation' email.
Task ID : 1943788
PR #31321
As the eLearning (website_slides) is also using website_profile users,
the All Users page is moved from website_forum to website_profile, to be
useable in both forum and eLearning.
This page displays also the number of karma point, badges and certificates
of each user.
The users are sorted by their karma points and the first 3 users are
promoted on a podium.
Use span instead of b tag in profile page
Task ID : 1922159
PR #31109
Since 56645335b7, when a user get a badge,
an email is sent. The subtype is not used anymore, so the alert
mecanism in forum to display a message to the user to show him
his new badges can not work.
This commit removes this dead code.
Task-1922159
Adds forum specific information into the website_profile template page.
Removes everything linked to profile that is already in website_profile module to avoid duplicates.
As there can be more than one forum, the profile page shows everything linked to every forum,
except if the forum id is given in url arguments.
The old route (forum/forum-1/user/user_id) have been kept for backward compatibility reasons.
Adds the 'Go to forum' button in the 'new rank reached' mail to encourage the users to continue
to be active on the forum as well, to gain more karma point and improve there rank.
Image rpc calls have been reviewed for profile page part to use only the standard way to get image
-> web/image/model_name/id/image_size
Task ID : 1922159
PR #30988
Model methods should be private by default unless they need to be
exposed via RPC on purpose (e.g. for the web client).
The `send_forum_validation_email()` method is only called by a
controller and has no reason to be exposed via RPC, hence the conversion
to private.
Closes#30669
Before this commit, notification_read raise a traceback on some button click.
Eg: Flag/unglaG
It was hidden in the console, but we can just avoid it too
closesodoo/odoo#30524
Force image to stay in their container (img_fluid could be removed by end user)
Stop to use row_users
now that we use bs4,
allow to be more responsive,
force height to be the same for each card.
Small imp replacing multiple if by elif
Decrease big margin between questions
Place tag on the top (if you have many tag, or very long, the ui is broken)
*: tools, web, website, website_forum, mail, im_livechat
This commit refactors ir_http to make it more readable
and flexible.
Move the resize function of web/image to odoo.tools
Co-authored-by: XavierDo <xdo@odoo.com>
Co-authored-by: Antony Lesuisse <al@openerp.com>
closes: #28563
task: #1908896
Now forum only allow to post message of type 'question'.
New 'modern' UI with Bootstrap 4
New moderation modal for bulk spam
Co-authored-by: qha <qha@odoo.com>
Co-authored-by: qsm <qsm@odoo.com>
Co-authored-by: jke <jke@odoo.com>
Thanks to @qha-odoo for UI
Thanks to @qsm-odoo for reviewSsss
closesodoo/odoo#29235
As commit 066cfc9598 did for other website_module, this commit make theses
2 modules multi-website compatible.
Mostly by:
- Adding website_id in form/list views
- Preventing routes from being accessed by wrong website (only needed for
admin as portal users will get a 403)
- Adapt search([]) with multi website domain
- Add domain in model converter in routes for URL autocomplete (eg menu URL)
Note that it is not needed for sitemap.xml
closesodoo/odoo#27528
This commit adds various fixes to blog and forum:
- Some templates were mising a name, resulting in ugly page title
(eg: forum_all)
- Latest Blogs page was checking seo keywords to display tags, maybe it was
coming from an old tag implementation that used seo keywords?
- If only one forum, land on it directly when accessing /forum, like blog
does
- ..
Set up env & tools for module website multiwebsite (blog, event, sale..)
website_id in modelConverter and ir_rule
add _compute_domain_keys to have a different cache per website
or rules would not be correctly website_dependant
eg: blog 1 on website 1, blog 2 on website 2
access blog 1 from website 1 => can access -> normal
access blog 1 from website 2 => can access -> should crash because (ir rule)
split mixing website.published.mixin and website.published.multi.mixin to have
website_id only on last one.
multi mixing will:
- override website_published compute to take current_website into account (not in backend)
- force website when clicking on published in backend
- website blog, website_sale, website_event, website_forum, website_slides are now multi website
Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
From this commit onwards, Date fields will return datetime.date objects and Datetime fields will return datetime.datetime objects, this implies a number of things that are clearly explained both in the ORM API for master.
This commit also introduces a number of helper functions for dates and datetimes that are exposed in tools.date_utils and fields.Date[time], explained in the documentation as well.
Task-ID: 47189
Before this commit, badge, user,... was available when a forum is archived.
Now we display a msg to explain to the user that the forum has been archived.
Related to task-33955