Commit Graph
279 Commits
Author SHA1 Message Date
Nicolas Martinelli 8a88bbeb8b [FIX] website_forum: translate the welcome message
opw-1884718

closes odoo/odoo#27273
2018-09-27 09:04:53 +00:00
Christophe Simonis fbfb91799e [MERGE] forward port branch saas-15 up to 9cf0dbe226 2018-08-21 16:00:40 +02:00
Christophe Simonis aafa6e38c4 [MERGE] forward port branch 10.0 up to 342d037373 2018-08-21 11:33:53 +02:00
Christophe Simonis 342d037373 [MERGE] forward port branch 9.0 up to f750393030 2018-08-21 10:50:32 +02:00
Olivier Dony f750393030 [FIX] website_forum: properly catch errors for email activation 2018-08-21 03:28:59 +02:00
Christophe Simonis 7f7b705236 [MERGE] forward port branch 10.0 up to 633a65d231 2018-07-17 16:36:29 +02:00
len-odoo a3fd6a2072 [FIX] web_forum: fix the comparison of tags ids
When checking if tags had changed, a missing .ids made it that a recordset was
compared to a set of ids (integers).
As a result, to make an edit the forum would always check that the user had
sufficent karma to retag, even if it was not needed.

opw 1866019
2018-07-17 15:27:35 +02:00
Christophe Simonis 44b77d3702 [MERGE] forward port branch saas-15 up to 1de78253ff 2018-07-17 17:08:50 +02:00
Christophe Simonis e3658d6f56 [MERGE] forward port branch saas-15 up to d44cd77884 2018-06-12 16:31:54 +02:00
Christophe Simonis b6496f8b38 [MERGE] forward port branch 10.0 up to 9032617120 2018-06-11 19:20:38 +02:00
Swapnesh Shah af752e7158 [FIX] website_forum: Fixed maximum recursion depth
Before this commit, you can set the question of a post like the post itself.
That will generate a traceback:
    RecursionError: maximum recursion depth exceeded in comparison

Now we check that there is no recursion
2018-06-11 16:49:38 +02:00
Martin Trigaux ff0abd214c [FIX] untranslated defaults
The field was translatable but the default value was untranslated

Fixes #22059
2018-01-10 08:57:12 +01:00
Christophe Simonis 6e25eb9b05 [MERGE] forward port branch saas-16 up to 4c410ee6a1 2018-01-09 17:03:07 +01:00
Christophe Simonis 4c410ee6a1 [MERGE] forward port branch saas-15 up to 38b201abce 2018-01-09 16:30:50 +01:00
Christophe Simonis e671cdcc44 [MERGE] forward port branch 10.0 up to 849d8ffd21 2018-01-09 15:12:51 +01:00
Christophe Simonis e3080d8433 [MERGE] forward port branch 9.0 up to 35c829f12b 2018-01-08 11:15:33 +01:00
Jeremy Kersten aaa8a87f36 [FIX] website_forum: check karma to allow to flag a post without rights to edit
If you set 200 kamra to allow to flag a post and 300 to edit all post, you was
not able to flag the post before this commit.

This commit closes #21274

@kangol: warning, fwd port need to add tag_ids into trusted_keys
2018-01-03 16:12:02 +01:00
Xavier Morel d18b160505 [FIX] website_forum: properly read the faq
On P3, "text" IO (open(f, mode='r')) will default to the encoding
provided by locale.getpreferredencoding(False) which apparently is
regularly cp1252.

Replace by misc.file_open which enforces UTF-8 decoding in text mode.
2017-10-17 17:10:31 +02:00
Christophe Simonis b8dd34fcbb [MERGE] forward port branch saas-16 up to 64d56995e0 2017-09-06 13:29:05 +02:00
Christophe Simonis 64d56995e0 [MERGE] forward port branch saas-15 up to ef5ac872b8 2017-09-06 12:26:36 +02:00
Christophe Simonis a9991e8082 [MERGE] forward port branch 10.0 up to abb726d4df 2017-09-04 18:47:40 +02:00
Christophe Simonis abb726d4df [MERGE] forward port branch saas-11 up to 431b30b478 2017-09-04 18:46:46 +02:00
Christophe Simonis 431b30b478 [MERGE] forward port branch saas-10 up to aab6bdd54a 2017-09-04 18:38:25 +02:00
Christophe Simonis 71f370903c [MERGE] forward port branch saas-16 up to 600d015938 2017-08-30 18:18:59 +02:00
Christophe Simonis 600d015938 [MERGE] forward port branch saas-15 up to cb4dbfb7b7 2017-08-30 18:04:40 +02:00
Christophe Simonis 583fcf0a67 [MERGE] forward port branch 10.0 up to 1b7e31f341 2017-08-30 15:34:58 +02:00
Christophe Simonis 792204ae9e [MERGE] forward port branch saas-11 up to dce35ca44b 2017-08-30 14:15:32 +02:00
Christophe Simonis f75fd6dcdb [MERGE] forward port branch 9.0 up to 24ca3793bf 2017-08-30 13:19:58 +02:00
Christophe Simonis 24ca3793bf [FIX] website_forum: do not compare recordset against integer 2017-08-30 12:45:35 +02:00
Xavier Morel 481a00dc4b [FIX] P3: hash/hmac payload must be bytes 2017-08-20 23:25:54 +02:00
Thibault Delavallée aab6bdd54a [FIX] mail, website_(blog/forum/slides): correctly redirect users on backend/frontend
/mail/view controller is a generic controller that redirects to a view
on a document either on backend or frontend depending on the module,
user and some model specific conditions.

However currently url computation is not always correct as you may end
up on frontend view even when you are a regular user that should land
on backend views.

In this stable version we introduced a key in the returned action that
indicates the action is a pure front-end (public) action or not. This
way people are correctly redirected to the backend or the frontend
when going through the controller.
2017-08-16 11:13:11 +02:00
Denis Vermylen e0a1549307 [IMP] models: add access_user to get_access_action
In order to be able to identify what action to return based on the
access_user.

Typically portal users will need to be redirected to the front-end,
while internal users will need to be redirected to the back-end.
2017-07-06 12:53:39 +02:00
Jérome Maes 56ed99cff5 [IMP] website_mail: extends mail.thread mixin to manage website messages
mail.thread mixin will (re)provide the field 'website_message_ids'.
Models can redifined its domain, since it can differ a bit (blog, forum,
... are not the same).
Even if the domain can differ, we still keep it on the mixin since
it will be required for the new chatter frontend (see following
commits).
2017-06-30 11:06:32 +02:00
Xavier Morel 01e3514147 [FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request,
.parse, .errors) which is inconvenient.

Since we already have hard dependencies on requests and
werkzeug(.urls, which is a backport of Python 3's unicode-aware
urllib.parse) migrate *everything* to that.

A sticking point is urllib2.URLError, those were (mostly) replaced by
the slightly more general IOError which URLError extends.
2017-05-15 12:26:30 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Christophe Simonis eddefc9948 [MERGE] forward port branch 10.0 up to 8c55e57c7f 2017-03-01 16:14:41 +01:00
Thibault Delavallée 12c51cd847 [FIX] mail_thread inheritance: add api.returns on override of message_post
As message_post is defined on mail.thread abstract class its api.returns
is not automatically added on overridden versions of the method. This
commit add missing api.returns on all overrides of the method.
2017-02-28 10:07:19 +01:00
Raphael Collet 6453e4eb23 [IMP] base: tighten ir.model.data access rights 2017-01-03 16:52:50 +01:00
Raphael Collet d0ca2d115e [REF] ir_config_parameter: remove group_ids and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
2017-01-03 16:52:49 +01:00
Thibault Delavallée 458aaca328 [IMP] mail: reimplement grouping of notification recipients
There is now a single method easier to inherit to add specific behavior
for the display of access button as well as actions buttons. All addons
using this mechanism are updated accordingly.
2016-09-23 10:01:41 +02:00
Thibault Delavallée a9bd9ab160 [FIX][IMP] various: unsudo mail/view controller and get_access_action
mail/view controller is a generic controller that redirects the user to a
given view, depending on the record and the user. Users may be redirected
to the backend form view, or to a website view. This is done notably by
calling get_access_action method that gives the action to perform (act_window
or url).

Previously this method was called using SUPERUSER. However it was therefore
impossible to know who the user was. This method is now called using the
current user. Various overrides of get_access_action have been updated to
add some logic and access rights check directly in the method allowing
more fine-grain behavior of the access action.
2016-09-23 10:01:04 +02:00
Thibault Delavallée 3311c57839 [FIX][IMP] website_forum: send comments on answers to people following the question 2016-09-02 17:36:03 +02:00
Thibault Delavallée c4246dc773 [FIX] website_forum: fix comment notification subject being forum.post() 2016-09-02 17:35:56 +02:00
Thibault Delavallée af703b8275 [IMP] mail, website_forum, website_blog: avoid storing message needaction partners
Forum and blog are public models that could have a lot of followers. After
notifying followers of a new comment, discard the needaction information.
For those models email is considered as sufficient. This way we avoid storing
a lot of unnecessary entries in the m2m table between message and partner.
2016-09-01 13:28:36 +02:00
Thibault Delavallée 2ae09150a5 [REM] mail, forum: remove hack to add buttons in forum notifications
It has been solved using the standard way of managing buttons in notification
emails. At least we hope it.
2016-09-01 13:27:49 +02:00
Thibault Delavallée 02c748be59 [IMP] tools: sanitizer: add and clean sanitize options
Now having

 * sanitize: run the sanitizer to clean the html (removing javascripts,
   unwanted tags, ...)
 * sanitize_tags: only a subset of tags is allowed in html content.
   Unwelcomed tags are remove dand their content stripped.
 * sanitize_attributes: only a subset of attributes is allowed.
 * sanitize_style: only a subset of style attributes is allowed. Style
   attributes are parsed to keep only a white list.
 * strip_style: all style is removed. It bypasses sanitize_style as there
   is no need to sanitize something that is removed.
 * strip_classes: remove class attributes

Fields parameters have also been updated to match the sanitize options. Html
fields by default are sanitized with sanitize_tags activated but without any
further options. All addons have been updated to match the new options
according to their previous behavior.
2016-08-30 15:54:56 +02:00
Christophe Simonis 235ed4b2c1 [MERGE] forward port branch saas-12 up to 9ad5f26 2016-08-20 18:08:19 +02:00
Christophe Simonis 9ad5f26b3f [MERGE] forward port branch saas-11 up to 3a2147d 2016-08-20 17:18:31 +02:00
Christophe Simonis 3a2147d95c [MERGE] forward port branch saas-10 up to bc1a0a3 2016-08-20 16:57:36 +02:00