Commit Graph

121 Commits

Author SHA1 Message Date
Olivier Dony 6377699c44 [FIX] website_forum: check karma access on direct message edit/unlink too
Access rights on messages are derived from the
access rights on the documents they are attached
to. Due to the karma-based nature of the forum
access rights, these do not automatically reflect
on messages, because they are not implemented as
access rules.
The check_mail_message_access() needs to be
overriden to achieve the same effect.

+ allow calling super().check_mail_message_access()
from new API (useful in forward-port)
2015-04-07 10:10:20 +02:00
Olivier Dony 64da3c5e17 [FIX] website_forum: hide questions coming from abusive users
When a user's karma is driven to a negative value
due to repeated abuse or the posting of spam,
automatically hide all their posts from public
view.
This will reduce the effectiveness of their abuse,
and simplify moderation and cleanup.
2015-03-09 14:41:14 +01:00
Olivier Dony 13476c844d [FIX] fields.html, forum: opt-in stripping of @style attrs
For public-facing HTML content provided by the user,
`<style>` tags and `style` attributes should be stripped
automatically, as they can easily be abused to deface
pages for abusive users and spammers.
<style> tags were already stripped, the optional `strip_style`
for fields.html enables the automatic stripping of style
attributes.

This is opt-in because custom style attributes are still
desirable in trusted HTML fields.
2015-03-09 14:41:14 +01:00
Martin Trigaux fc9ce0bcff [FIX] website_forum: description not translated
Make the field description on a forum translatable and add it in the forum view. opw 619786
2015-01-15 15:37:31 +01:00
Jeremy Kersten 0de1d89648 [FIX] website_forum: add name get on forum.post #4364
When comment is created, emails are sent with subject: "Re: False" and footer: "About Forum False".
Now, when the post is a comment, we fallback to the name of the parent (the main forum post).
2015-01-12 15:27:32 +01:00
Christophe Matthieu 6471fa6ddb [FIX] website_sale: Discussion not working on product and gives '500: Internal Server Error' if public user try to comment on product (without login). Need to redirect to the login page (all user who want to write a comment have already buy the product and can use the portal login) 2015-01-05 13:30:36 +01:00
Jeremy Kersten 0313218123 [FIX] website_forum: Forum, use old API in v8. forum was not a browse record, so we need to re-browse. Tags: Force to delete tag. Before old tag deleted was not removed from relation, Now we use a 6 to force the update, followed by 0 to create. 2014-11-26 17:44:52 +01:00
Jeremy Kersten fc329b6eeb [FIX] website_forum: use common method to compute tags for orm 2014-11-18 11:27:09 +01:00
Olivier Dony b8efdbdf39 [FIX] website_forum: avoid access error when closing spam/abuse questions
Logging the user login is not necessary, but
accessing it might cause access errors. Logging
the UID is equivalent anyway, so let's not bother.
2014-11-10 16:20:23 +01:00
Olivier Dony 6c55dab261 [FIX] forum: closing spam/offensive questions should give author karma penalty
This is a partial patch for issue #3460, pending more
improvements and refinements in master.

Currently the karma penalty is hardcoded to 5*downvote penalty,
which may or may not be sufficient to prevent posting, depending
on the other karma levels.
2014-11-05 17:09:10 +01:00
ssh-odoo ef8099424d [IMP] [TEST] website_forum: security fixes + tests
- fixed voting, karma check could be avoided
- fixed posting comments, now correctly checking karma (not for
notifications)
- fixed bootstraping of users, now not allowed to ask questions by default;
added validation email that gives the first karma points required to
participate
- added tests
2014-10-23 11:36:03 +02:00
Olivier Dony b9953acb0f [FIX] website_forum: respect karma when posting questions/answers/comments + more user-friendly errors
While posting new questions and answers the check
for karma limit was bypassed because it was using
super-user mode: use regular user instead.
Also improve the user feedback when karma level is
too low to perform some actions: post comment,
post question, post answer.
The usability in these cases still needs to be
improved.
2014-10-21 01:23:28 +02:00
Martin Trigaux 78fa861936 [IMP] website_forum: performance improvements
- avoid to browse on every question/answer, only the 20 most recent ones (need to manually update the view to see the real number of q&a)
- do not render hidden tabs (leakage of information and useless rendering)
- add related fields to speed up vote search (need to be stored to be efficient)
2014-09-03 08:44:48 +02:00
Denis Ledoux a8d667eeb7 [FIX] website_forum: convert answer to comment, use superuser
To browse the forum post, as the partner of the create_uid of the post is needed, which can't be read by portal users.
2014-08-29 14:18:36 +02:00
Olivier Dony ef53a831c6 [MERGE] Forward-port saas-5 up to a5f7891 2014-07-23 16:58:00 +02:00
Denis Ledoux a5f7891b68 [MERGE] forward port of branch saas-4 up to 5739aebfb1 2014-07-23 13:18:30 +02:00
Thibault Delavallée 9955624029 website_forum: fixed issue when voting. The method should work in batch. Previously to this implementation having one post with a vote bypassed the other posts without vote when called with several ids. 2014-07-16 10:39:38 +02:00
Christophe Simonis e0759c1350 [MERGE] forward port of branch saas-4 up to de696f1 2014-07-15 10:39:08 +02:00
Thibault Delavallée 59320c4ab6 [FIX] website_forum: fixed karma computation, on first vote the karma was wrongly calculated (when creating a vote, not when updating it). 2014-07-11 16:46:39 +02:00
Christophe Simonis f654a7719b [MERGE] forward port of branch saas-5 up to 73d39a0 2014-07-10 22:49:53 +02:00
Thibault Delavallée abbe4ef76c [FIX] website_forum: fixed issue with user vote badly taken into account when upvoting / downvoting + crash due to wrong field name. Backport of Leonardo Donelli PR for master. 2014-07-10 09:03:53 +02:00
Hitesh Trivedi ea470b67bf [FIX]Display answers in order by posted date in descending (latest to old) 2014-07-07 12:00:19 +05:30
Thibault Delavallée 7785a3bc83 [FIX] website_forum: fixed last merge done a bit quickly: addd can_answer functional field, fixed edit_answer and edit link / route. 2014-07-01 14:07:53 +02:00
Thibault Delavallée 2a4ec367a9 [IMP] [FIX] website_forum: cleaned and improved the management of available actions based on the user's karma. The karma levels are now stored on the forum itself, allowing customization. The various check of karma are done at model level and not at controller level anymore, leading to a more secure and easier to inherit behavior. 2014-07-01 10:29:37 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Thibault Delavallée a3cfed1809 [IMP] website_forum: added management and support of private profile (unpublished partners). 2014-06-12 16:33:33 +02:00
--global 2649beba97 [IMP] website_forum: make forum;forum inherit from mail.thread. This way we
add the possibility to users to follow a forum and be automatically followers of new
questions, using some new subtypes on the forum.forum model that do the auto subscription.

Also added a profile link on the forum, when logged.

Also added a subscribe button on the forum.
2014-05-22 13:49:41 +02:00
Martin Trigaux 4c822b1a3b [FIX] website_forum: when sending emails about forum post, use the public url instead of the private 2014-05-20 13:10:44 +02:00
Olivier Dony c97d0ccf8f [FIX] website_forum: allow users to save their edited bio 2014-05-20 10:24:01 +02:00
Martin Trigaux f0c1eb1786 [FIX] website_forum: execute the change of number of views in SQL instead of using the orm
Using sql will be faster (doing a write in a read is never a good idea for performances) and will not update the write_date (which is used for the last activity filter)
2014-05-15 10:57:51 +02:00
Thibault Delavallée 69ec02b2d4 [FIX] website_forum: more fixes :
- display tag name in 'filter' bar when filtering on a tag
- display active tag in a blue color
- order answers: correct first, then most upvoted

bzr revid: tde@openerp.com-20140506123001-fz5gt6i9zw6ondcu
2014-05-06 14:30:01 +02:00
Christophe Simonis 12beacda08 [MERGE] backport of trunk revisions:
9362 fp@tinyerp.com-20140421205739-rki3bctinjy3amzy [MERGE] new module: website_forum_doc + small fixes (close) in forum
9363 fp@tinyerp.com-20140421213850-19gk3hfz8qxa6fw3 [IMP] improved form view for posts

bzr revid: chs@openerp.com-20140422143249-3cfh18tenn3a5ry1
2014-04-22 16:32:49 +02:00
Thibault Delavallée aa8bdfc740 [IMP] website_forum: controllers now check the karma in addition to the viewé
bzr revid: tde@openerp.com-20140418144722-k2g2gespb3dwpio4
2014-04-18 16:47:22 +02:00
Thibault Delavallée b153fcd35e [IMP] [FIX] website_forum: better control of actions based on karma; those
actions are calculated in the controller, based on forum.forum values instead of values hardcoded
in the view.

bzr revid: tde@openerp.com-20140418135724-k64yey6hhrki0b6h
2014-04-18 15:57:24 +02:00
Thibault Delavallée a6103a08be [IMP] [FIX] website_forum: better karma management for votes
and answers. Also some fixes in answer tagging and edition closing.

bzr revid: tde@openerp.com-20140418132905-ja2rqcc2edqzu3jv
2014-04-18 15:29:05 +02:00
Martin Trigaux 3755fa19a5 [IMP] gamification and website_forum improvements
gamification:
- fix batch mode when grouping by id
- fix subquery in batch mode when a ending date is set
- serialisation method can exclude categories of challenge
- view improvements

website_forum:
- enabling bages in batch mode
- fix karma computation when creating a new post
- changing previous vote affects the user karma
- do not display forum challenges on user home page

bzr revid: mat@openerp.com-20140415162400-78cklbdw0bmn94zr
2014-04-15 18:24:00 +02:00
Martin Trigaux 35c7f4814d Allow overwrite of the serialising method to exclude some categories in the challenge search
bzr revid: mat@openerp.com-20140415134809-uconkvnp0z32jxjs
2014-04-15 15:48:09 +02:00
Martin Trigaux bc0738e47e One morning I shot an elephant in my pajamas. How he got in my pajamas, I don't know.
bzr revid: mat@openerp.com-20140415131929-6pktlodmlgr2fuwz
2014-04-15 15:19:29 +02:00
Martin Trigaux 14ff39f96e [FIX] website_forum: mooooore baaaaaadges
bzr revid: mat@openerp.com-20140415101842-yf6vndw7h62q0b42
2014-04-15 12:18:42 +02:00
Martin Trigaux c40318a46a [ADD] website_forum: self_reply field and some badges
bzr revid: mat@openerp.com-20140414145415-8g9jtp95d173183i
2014-04-14 16:54:15 +02:00
Thibault Delavallée 7d834f0579 [IMP] website_forum: cleaned post cfreate and write
+ corrct subtype trigger

bzr revid: tde@openerp.com-20140411180615-bznyth4tv7e89sed
2014-04-11 20:06:15 +02:00
Thibault Delavallée 62fde442cb [CLEAN] website_forum: res_users: cleaned dead code
bzr revid: tde@openerp.com-20140411180550-pucr84e70or4jhy0
2014-04-11 20:05:50 +02:00
Thibault Delavallée 8540a63aa6 [CLEAN] website_forum: gamification: removed code about ongoing challenges
as it is now a feature in trunk.
Also removed unnecessary column redefinition.
Also removed an override in users, will see if necessary.

bzr revid: tde@openerp.com-20140411160003-tffx54f2evjh4r70
2014-04-11 18:00:03 +02:00
Thibault Delavallée 68cb0dca6f [FIX] website_forum: temporary fix to enable the counter
computation at creation.

bzr revid: tde@openerp.com-20140411153724-8x7o0o774uf5g2x2
2014-04-11 17:37:24 +02:00
Thibault Delavallée cd4afee17e [CLEAN] website_forum: cleaning before merging
- cleaned models
- cleaned controllers: lots of cleaning, rewriting, simplfiication + updated in views
- added an override of the contact widget, to be able to display partner-related
stuff about karma and badges
- some css tweaking
- badges cleaning

bzr revid: tde@openerp.com-20140411132939-bmvyc9bqpqpkk843
2014-04-11 15:29:39 +02:00
Thibault Delavallée 4b776a90c0 [FIX] website_forum: user_id -> create_uid
bzr revid: tde@openerp.com-20140410142802-i8kyicrju7wmikem
2014-04-10 16:28:02 +02:00
Thibault Delavallée cbac424f91 [REF] website_forum: renamed models (website.forum -> forum) + cleaned models.
Added favorite_count function field, like vote_count and so on, to be able
to have badges based on a simple model.

bzr revid: tde@openerp.com-20140410133928-i0lncz8us9wueb13
2014-04-10 15:39:28 +02:00
Thibault Delavallée 67ef7ba855 [IMP] website_blog: moved res_users inheritance into its own file, and added
the field in the view.
Also added some fixes in the messag_post hwen creating an answer.

bzr revid: tde@openerp.com-20140410101658-a1o5h3g5ehlg0e8t
2014-04-10 12:16:58 +02:00
Thibault Delavallée 73cb78e211 [CLEAN] website_forum: cleaned vote feature before merging
bzr revid: tde@openerp.com-20140409173941-4pc7p8bre5btgbhu
2014-04-09 19:39:41 +02:00
Thibault Delavallée 21e3164f94 [CLEAN] website_forum: views is now a simple counter, incremented each time
someone see the question. Also use message_is_follower instead of re-implementing its
feature by checking the followers.
Views is updated through a method on the post object, incrementing the views counter
by 1.

bzr revid: tde@openerp.com-20140409172522-pwehz1k9z5rf765s
2014-04-09 19:25:22 +02:00