Commit Graph
343 Commits
Author SHA1 Message Date
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Thibault Delavallée 11df1af102 [MOV] website_forum: rename remaining files
PURPOSE

Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.

SPECIFICATIONS

Rename remaining files: controllers, sub-modules, tests, ...

Task-3240082 (Forum: Reorganize and lint module)

Part-of: odoo/odoo#114841
2023-03-22 17:03:23 +01:00
Jeremy Kersten f20f6667fa [FIX] website_forum: add default value for forum_origin
We have a lot of hits without any forum_origin which will raise an
error 500 because this parameter is required. But because this params is
not into the controller but received as a get parameter, it will match
the controller and return an error 500 instead of a beautiful 404.

Some controller like 'open_partner' redirect to this url without the
parameter forum_origin too, leading in a 500 in all cases.

Better for uX to have this param, but not critical to display the page.
The only negative impact will be to have a 'Back' button that return to
this new default value '/forum'.

closes odoo/odoo#114461

X-original-commit: 991d1c430f2c9bb0d2b2d7ac8f75338eafd2aced
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-07 02:56:41 +01:00
Benoit Socias f2e20e5377 [REF] website, *: make search options inheritable
*: website_blog, website_event, website_forum, website_slides

With [1] it has been made easier for partners to extend search options.

This task introduces similar inheritable functions for blog posts,
events, forum posts, slides, pages and hybrid results.

[1]: https://github.com/odoo/odoo/commit/d29f2f3ac5f8c3e8109287e0933609bdbe0cadb1

task-2897924

closes odoo/odoo#97908

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-28 18:50:49 +02:00
xO-Txandqsm-odoo 4c2f3389aa [REM] *: remove new content controllers
*: website_event, website_event_sale, website_forum, website_sale,
   website_sale_slides, website_slides, website_slides_forum

This commit removes the remaining controllers that are no longer used
since the use of form views on website new content dialogs (following
the website in backend merge at [1] and the many iterations afterwards).

With the website in backend work, a feature was lost for the creation of
events: dummy tickets were created. This commit actually removes the
feature for good. Events default values are managed by templates.
Moreover there are links in frontend to edit the event when being
allowed to edit it (event groups), notably when there is no ticket in
registration page. So it makes no sense to create dummy tickets, without
price, for 1000 seats. Those values are random so they will have to be
edited. Better let users create real tickets if necessary, than editing
and/or removing dummy tickets.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#102928

X-original-commit: d559ce5d1518ac1293db1c4f52efb8094daf5b49
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-10-10 19:03:15 +02:00
Guillaume (gdi)andqsm-odoo c2f394253e [IMP] website, *: improve the "edit in backend" button
*: base, mrp_account, product, mail, website_blog, website_event,
   website_forum

This commit improves the button that allows to go to the backend view of
an object when you are on its corresponding page on the website. The
button is more visible and the user can see which object he is going to
edit. Note that this commit also:

- Changes the access key to translate a website page to ALT + T.

- Adds a new access key to edit an object in backend with ALT + E.

- Removes the possibility to duplicate a blog post (but this feature
will be reintroduced later for all models, generically) **.

**: Note that the duplication of blog posts actually had a mistake:

The controller to create a new blog post has been added with [1] where
it has been decided to not be a follower of the blog posts at their
creation. A new controller has been added by [2] to be able to duplicate
a blog post, to be consistent with [1], here also the user does not
become a follower of the new blog post (the copy). So far, so good.
Finally, [3] has changed the blog post creation controller so that the
user who creates the blog post is a follower of the new blog post.
Unfortunately the same change was not made for the duplicate controller,
which is a mistake. There is no reason to be a follower of the newly
created blog posts when you go through the add blog post controller but
not when you go through the duplication controller. The behaviors should
be consistent and there is no reason for there to be a difference.

[1]: https://github.com/odoo/odoo/commit/4c3b516a7b988d758a67ff19242e8ed0837d756c
[2]: https://github.com/odoo/odoo/commit/fe40538aff2b65f7719840c8e2d6e51e858f560f
[3]: https://github.com/odoo/odoo/commit/4bf9dc4078a5ca413539a6fd16400fd5aad46907

task-2889929

closes odoo/odoo#97353

Related: odoo/enterprise#30075
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-09-04 18:29:37 +02:00
Romain Derieandhoangtiendung 1186cd1c40 [FIX] website_forum: fix tag click event not found records
A forum tag is always linked to a forum.
But some flows are not considering that part and are returning/using
tags from other forum too.

Step to reproduce, having 2 forum `Cats` and `Dogs`:
- Create a `Food` tag on the `Dogs` forum
- On the `Cats` forum, type `Food` in the tag input
- First error: the `Food` from `Dogs` incorrectly shows up
  It means that the user can't create a new one from the `Cats` forum
  but will actually have to select (without know it) the one from the
  `Dogs` forum.
- Select that tag anyway
- Second error: The tags displayed on the post is redirecting to the
  wrong other forum, ultimately not showing the post from all forums
  (and the one you just came from).
- Third error: The /tags page won't list the `Food` tag on the `Cats`
  forum.

Note that there is probably some access traceback involved in a multi
website and/or multi company setup.

After this commit:
- only the tags from the current forum will show up and be selectable
  when creating a post.
- it will be possible to create a new tag for a forum is another forum
  already has a tag of that name
- the tag on the post (next to its title) will not redirect to the
  incorrect (and possibly not accessible) forum

Note that the method was already reading multiple properties of `self`,
it was already not an `api.model` method anymore.

closes odoo/odoo#94917

X-original-commit: 4ff52d0b9a71d3072f5973d8e900d802e6b129c0
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: hoangtiendung <hoangtiendung070797@gmail.com>
2022-06-30 20:56:14 +02:00
Gorash b0a2a41d78 [IMP] all/website: using lazy values and t-cache in templates
Using lazy values allows you to not do query when the content is not
displayed or if it is already cached. Adding `t-cache` only reduces
render time, but combining it with lazy values saves browses, computes
and query.
Thus for the `/shop` page the page is displayed in 60ms (before: 250ms).

Part-of: odoo/odoo#88276
2022-06-03 16:40:40 +02:00
Huy 76ee79749a [FIX] website_forum: avoid error when the sort param is encoded
Currently, when accessing a URL with a sorting encoded value,
the system will raise an error with a specific message, which
feels unfriendly to the user as well as saves unnecessary logs
in the log file. So we decoded that value, if except then sort
a page without sorting.

closes odoo/odoo#89072

X-original-commit: 33356fcc9867ee23fee2a032dcca7daea1ada4c5
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-04-19 18:39:55 +02:00
Rémy Voet (ryv) 534087fa8d [REF] core: simplify tooling of browse()
Remove str from IdType, because those kinds of ids are no longer
necessary, and lead to unusable recordsets.

Because IdType now only contains int and NewId, simplify (and speed up)
the conversion of the parameter of browse().

Preferably wrap single NewId into a tuple instead of a list, as tuples
are faster.

closes odoo/odoo#83687

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-21 10:28:15 +00:00
Gorash 94c5caa4d6 [REV] website: revert commit ability to restrict groups on website menu
revert https://github.com/odoo/odoo/commit/b5091c7017a08806e2730765c14261408307aeec

fp asks to remove the groups on the menus to simplify the
model and allow the menu to be cached in the future. The user can change
the templates, use the big menu, add custom t-if, groups...

task-2737973

closes odoo/odoo#83505

Related: odoo/upgrade#3208
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-18 14:28:40 +00:00
Martin Trigaux cfb9967d37 [FIX] website_forum: set return content-type
The request being of type http, the returned Content-Type was
text/html while the select2 request exepected json in the dataType
2021-12-20 13:55:00 +01:00
Hardik Prajapati 3d2fe2f2d8 [FIX] website_forum: fix forum back button url from backend
Currently, when user open the question from helpdesk ticket and
user clicks on the back button of the forum page,
it redirects the user to the app switcher. It happens because the
back button contains the homepage URL as httprequest.referrer
does not support the fragment url with hash(#).

so this commit fixes the issue by binding the onclick event on the
back button so clicking on the back button redirects the user
to the helpdesk ticket.

task-2602604

closes odoo/odoo#77458

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-04 11:07:16 +00:00
Dhwani Patelandjpr-odoo d69c49349b [IMP] website_forum: improve the flagging question UX
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>
2021-10-14 12:26:09 +00:00
Benoit Socias 7559626c54 [IMP] website, *: make a generic search bar snippet available
(*: 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
2021-09-03 06:59:33 +00:00
Martin Trigaux 15692f3948 [IMP] *: merge ir.model.data helpers
remove _get_id and _get_object_reference that were one liner to
_xmlid_lookup
2021-08-10 13:49:05 +02:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
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 ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
Romain Derie f2583f3de4 [IMP] website(_*): prevent wrong multi website access during dispatch
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 #63499

closes odoo/odoo#64313

Related: odoo/enterprise#15688
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-01-25 11:01:13 +00:00
Simran Gajsinghani 6f9a2ca2fb [IMP] website: show searched pages count on website pages
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

closes odoo/odoo#40121

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-17 10:25:28 +00:00
Benjamin Vray 641e967652 [FIX] website_forum: preserve user filters in URL
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/56248

closes odoo/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>
2020-10-30 18:24:07 +00:00
Jeremy Kersten 6538e20bb6 [FIX] tools.sql, website_*: increment counter with skip lock
*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.

closes odoo/odoo#58765

X-original-commit: d92e61e89f468c2db2fbd68b2f0d6b36c77f1065
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-29 08:48:59 +00:00
Jeremy Kersten 41bac94162 [FIX] website_[blog, forum]: fix loop in retro compatible routes
Purpose of the retro-compatibility route was to redirect the old to the new.
And not redirect to themself and create a loop

closes odoo/odoo#58672

X-original-commit: b5e1bafeb42e94b587c245e9e7aa844770a129c6
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-28 12:20:39 +00:00
Jeremy Kersten 9577dcbc3a [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
Retro-compatibility routes
2020-07-22 06:53:37 +00:00
Jeremy Kersten 01c17707bd [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
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
2020-07-22 06:53:37 +00:00
Jeremy Kersten 52a0406a2c [IMP] website_forum: delay the set_viewed
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.
2020-06-08 07:43:06 +00:00
Jeremy Kersten 84ff744eb0 [IMP] website_forum: perf - use the stored field instead to recompute it 2020-06-08 07:43:06 +00:00
Okan SUMER (osu) 645056554e [IMP] website_forum: frontend improvements and corrections
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
2020-05-14 18:27:00 +00:00
fja-odoo c54824dfee [IMP] website_forum: hide negative karma posts
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

closes odoo/odoo#46194

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-25 09:05:02 +00:00
Sébastien Mottet (oms) e3b5b20b39 [IMP] website_[profile|forum]: show filtering forum on user profile page
- 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

closes odoo/odoo#48665

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-08 07:21:48 +00:00
jvm-odoo 15227170cb [FIX] website_forum: fix answer name disappear after edit
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

closes odoo/odoo#48970

X-original-commit: c53f1c6a58b4c8c9e9b3c87f27281c9bfd65a0e1
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-04-03 11:58:56 +00:00
jbm-odoo 49d64a8fb1 [IMP] website_forum: Add privacy
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.

closes odoo/odoo#43486

Taskid: 2169965
Related: odoo/upgrade#758
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-28 08:58:43 +00:00
jvm-odoo 12fa83bb44 [IMP] website_forum: improving forum header UX
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

closes odoo/odoo#46454

X-original-commit: 307e6cd5b44b8f619a35056557f72aae241943b3
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-02-27 13:51:53 +00:00
Romain Derie 6898fec5a6 [FIX] website_forum: set website_id when created from frontend
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 #45749

closes odoo/odoo#46126

X-original-commit: 08540d7853d497e326182e822b359cd6fcb05d59
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-02-24 14:44:58 +00:00
Romain Derie b997684b06 [IMP] website, website_*: improvement of 7dd70438e1
* 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

closes odoo/odoo#45622

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-18 16:04:11 +00:00
Thibault Delavallée e2b33f460d [REF] mail, various: rename subtype parameter of message_post to subtype_xmlid
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
2019-12-02 15:18:44 +00:00
Goffin Simon 8588649c12 [FIX] website_forum: Empty question error
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

closes odoo/odoo#39675

X-original-commit: 51f660c9a66f2e6aecb51e476d815b2f083f843d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-10-31 16:38:08 +00:00
Jeremy Kersten e19227d3ba [IMP] website*: clean sitemap
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

closes odoo/odoo#39427

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-28 10:36:56 +00:00
Romain Derie 9b38bcec12 [IMP] website, website_*: improve edit in backend feature
*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
2019-10-02 07:13:26 +00:00
c8c8eb3d56 [IMP] website_forum, *: revamp design
* web_editor, website_profile

Part of https://github.com/odoo/odoo/pull/35749
task-2024197

Co-authored-by: Jérémy Kersten <jke@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Co-authored-by: fja-odoo <fja@odoo.com>
2019-10-01 16:52:20 +00:00
fja-odooandqsm-odoo 83284a962c [IMP] website_forum: make the user auto-follow the posts he favorites
Part of https://github.com/odoo/odoo/pull/35749
task-2024197

Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-10-01 16:52:20 +00:00
Andrea Ulliana f9c2716b3e [IMP] website_forum: bring forum modes
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

closes odoo/odoo#34097

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-02 16:32:29 +00:00
fja-odoo e26d23cb97 [FIX] website_forum: remove unused close notif event
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
2019-06-28 08:53:53 +00:00
Sébastien Theys 9bdecc7b61 [IMP] product, *: remove deprecated fields and methods
* = mrp, sale, website_forum, website_sale, website_sale_comparison

closes odoo/odoo#34121

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-14 12:17:35 +00:00
Toufik Ben Jaa ea92ce6018 [FIX] website_forum: access right issue on validation queue
- 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.

closes odoo/odoo#33626

Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
2019-05-23 15:03:17 +00:00
David Beguin fb40c6bf60 [IMP] website(_profile,_forum,_slides): move validation email to profile and use in forum and elearning
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
2019-03-15 14:58:28 +00:00
David Beguin 2c01452d4b [IMP] website(_profile,_forum,_survey) : redesign website all_users page
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
2019-02-18 15:15:06 +00:00
jem-odoo ec212de5c7 [IMP] gamification,forum: remove deprecated alert when sending badge
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
2019-02-14 09:24:10 +00:00
David Beguin 336a90e530 [REF] website_forum : use website_profile templates and adds forum specific information
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
2019-02-14 08:30:29 +00:00
Swapnesh Shah 1971557fdd [IMP] website_forum: make method private
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
2019-01-30 22:59:08 +01:00