Commit Graph
16 Commits
Author SHA1 Message Date
jem-odoo 5937d13cf3 [FIX] portal: avoid strange domain when fetch messages
When fetching messages from the portal controller, we might
give a domain to restrict the message selection. Typically,
the ecommerce allows users to submit messages with rating
of the product. Users are allowed to filter the messages
with a certain rating.
Passing a non-normalized domain to this controller could
give strange result, as the code was using `+=` to concat
domains; some result domain could have been correct, but
return some strange results.

This commit normalizes all domains used in the code
making a non-normalized domain (given as parameter) crashes,
instead of returning unexpected messages.

Closes #26939
2018-09-16 12:32:24 +00:00
Lucas Perais (lpe) bd4b50f75a [FIX] account*, sale*, website_event, portal: public user not necessarily in right company
Have the main company (A) with the public user
Have an invoice in company B

Make a brand new browser access the invoice with the token

Before this commit: the token link ended up asking the customer to login,
eventhough it wouldn't if the invoice were in company A

After this commit: the whole payment with access token flow works as expected.

OPW 1879999
closes #26744
2018-09-18 11:02:58 +02:00
Nicolas Lempereur f6a74f40b5 [FIX] portal: typo in domain portal_message_fetch
In bd4f09f there was a typo in the domain portal message fetch (two `&`
instead of one), luckily this did not cause an error in 11.0

But in master expression.AND normalizes the domain, thus we got an error.

opw-1819702
closes #25131
2018-06-07 15:17:05 +02:00
Martin Trigaux 8b8815f44c [FIX] http_routing: translate without website
web (tagged with `openerp-web`) translations are loaded in the backend, in
`odoo.addons.web.controllers.main.WebClient.translation(mods=None, lang=None)`
method (through `/web/webclient/translations` controller).

In website, the controller `/website/translations` is called used, fetching
the translations from modules with the (fragile) clause `name ilike 'website'`

This commit fixes two bugs:

1. Install `website_sale`, activate discussion on products
  -> the chatter is not translated as the portal translations not loaded in the
     `/website/translations` controller

2. Install `helpdesk` but not `website`, go to portal view of a ticket
   -> the heldesk chatter is not translated as the `/website/translations`
      controller is not called (only provided by the website module)

This patch implements a modular approach to translate the web resources of the
right modules only.

The controller /website/translation is moved to http_routing and each module
override the new _get_translation_frontend_modules_domain method to adds its
translatable module

Closes #23618
Fixes #23610
2018-04-11 16:55:14 +02:00
Nicolas Lempereur 18a5a7a935 [FIX] portal: show line return in chatter message
In the frontend only plaintext is saved without any javascript fiddling
so in the controller it should be adapted to be saved.

With this change, the behavior is more similar to backend chatter which
sends html (processed by javascript) to the server.

opw-1817918
closes #23706
2018-03-16 16:26:26 +01:00
Nicolas Lempereur bd4f09fa72 [FIX] portal: no note in frontend chatter w/ token
When a chatter is displayed and the document is accessed with a valid
access_token, the message related to the document are searched in sudo.

This bypass valid filtering we may down the line.

This change apply the filtering so note type messages are not displayed
for user who are not employees.

note: before 11.0 this logic was in 1b5c2ced. In future version it would
      probably be better to have a method eg. _get_domain_based_on_user
      that would be called before sudo and if not sudo.

opw-1819702
closes #23544
2018-03-08 13:41:08 +01:00
Christophe Simonis b37cc1f9b7 [MERGE] forward port branch saas-16 up to a2ea4ba095 2017-12-12 18:39:43 +01:00
Thibault Delavallée b72b10c191 [FIX] (account, sale)_payment: fix URL generation in payment
Redirections are not correctly computed when the error or success urls
already contain some query parameters, like the access token. We now
use a function added in portal module that correctly computed the
redirection using standard werkzeug methods.
2017-10-27 10:36:07 +02:00
Olivier Dony bb0404ea30 [IMP] website_mail: simplify helpers for external post
After removing the `sha_in` params a while ago, we get rid of
the deprecated `token_field` option.

- Make `token_field` a model attribute, so that each model can easily
  define the token field that should be used, and it does not need
  to be passed around all the time anymore.

- Rename `_special_access_object()` to `_has_token_access()`, much more
  readable since it returns a bool

- Do not forward the `attachment_ids` keyword arg to message_post,
  as it sometimes contains unrelated IDs (the helper is not meant
  to post attachments anyway)

- Update callers accordingly
2017-09-21 23:42:45 +02:00
Thibault Delavallée 8b384ae612 [FIX] portal: remove condition for customer details breaking tests
Original commit e38de9dfa4 is about CSS classes and state code
update. It is not clear why hiding Your Details in some cases improve the
state code update. Forward port 017ee5eab3 broke the customer portal
display using this condition. This commit fixes the customer portal by
removing the condition.

Second part of the original fix that was about using a correct base layout
to render the your details page is already done in master since the
customer portal cleaning.
2017-08-24 17:08:37 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Jérome Maes 3cfd64f63f [MOV] portal,website_mail: move chatter frontend to portal
This split responsiblilies :
- portal provides basic chatter for portal document, and
website documents (slides, blog, ...).
- website_mail provides comments moderation (unpublished mail
message)
- website_rating integrate rating when posting comments
2017-08-16 14:56:40 +02:00
Thibault Delavallée 04e8bac285 [IMP] portal: limit records pager to models having a website or portal url
Purpose: use portal.mixin recently introduced
2017-08-09 17:46:21 +02:00
Thibault Delavallée ea27c1b7a3 [MOV] website_portal, portal: move customer portal to portal module
This commit moves the whole customer portal to the portal module.
It now completely uses portal and http_routing features and is not
dependent on website anymore.

An override of web controller is added in portal in order to redirect
portal users to /my instead of /web. That way once having the customer
portal installed all share users are correctly redirected to their
account.

All modules defining customer portal templates and controllers are
updated accordingly.
2017-08-08 14:58:49 +02:00
Thibault Delavallée b4b6ae44fd [MOV] website, portal: move pager support from website to portal
As customer portal will be moved to portal module support of pager
has to be moved previously to the various portal moves. This commit
moves the pager code and template to portal.

Compatibility using website-based pager is provided to avoid having
to update all website addons currently. Future commits will make
addons use the portal pager instead of website pager.
2017-08-08 14:53:50 +02:00
Thibault Delavallée da8d418ff0 [ADD] portal: add module for customer portal and sharing features
This module adds required base code for a fully integrated customer
portal. It contains the base controller class and base templates.
Business addons will add their specific templates and controllers
to extend the customer portal.

This module contains most code coming from odoo v10 website_portal.
Purpose of this module is to allow the display of a customer portal
without having a dependency towards website edition and customization
capabilities.

Some CSS files used in frontend assets are already moved to have a
working portal skeleton. A is_public method on users is also added
as it will be used in various portal code soon.
2017-08-08 14:23:58 +02:00