Commit Graph
5187 Commits
Author SHA1 Message Date
Thibault Delavallée 6e2a455947 [FIX] mail: restrict write access rights of portal users to their own follower and notification entries 2016-09-14 16:45:01 +02:00
Thibault Delavallée 9c9ac8c43a [FIX] mail: browse message as superuser when fetching recipients and notification data for chatter
Indeed accessing a m2m applies record rules, meaning recipients are stripped for public and portal
users. However when displaying recipients of a chat it is necessary to know which are the
recipients.

Moreover a crash occurs when accessing notifications about email being sent or not. As messages
in the tree are now browsed as super user there is no access rights issues anymore.
2016-09-14 16:45:01 +02:00
Thibault Delavallée 7f8fb0dbfb [FIX] mail: add default recipients only when not having one specified 2016-09-13 18:02:44 +02:00
Thibault Delavallée 0da908db83 [FIX] mail: fix error when calling channel_invite when inviting someone on a channel 2016-09-13 11:04:14 +02:00
Thibault Delavallée 1e37196e8c [IMP] mail: remove needaction on last found message when assigning as now an email is sent 2016-09-13 10:53:40 +02:00
Damien Bouvy 629a747d13 [FIX] mail: fix the update notification
The registration code was apparently not tested properly. Or at all.
2016-09-12 13:57:42 +02:00
Christophe Simonis 298e2032ea [MERGE] forward port branch saas-12 up to 9f28139 2016-09-09 18:13:31 +02:00
Christophe Simonis 7a02b90e17 [MERGE] forward port branch saas-11 up to dc4d6b6 2016-09-09 15:43:06 +02:00
Christophe Simonis dc4d6b6a7a [MERGE] forward port branch saas-10 up to e1bd405 2016-09-09 15:14:39 +02:00
Christophe Simonis e1bd405d8c [MERGE] forward port branch 9.0 up to af87c57 2016-09-09 11:49:48 +02:00
Martin Trigaux fb74fec3f5 [I18N] export 10.0 source terms 2016-09-07 11:08:42 +02:00
Martin Trigaux 05d91ea4e9 [I18N] update saas-11 translations by merging 9.0 and master
Without fuzzy-matching that is too flexible and error prone.
Was matching on wrong source and got translation without '%s'
2016-09-07 09:40:37 +02:00
Nicolas Martinelli 502f22e2ba [FIX] mail: link in chat messages
Commit f30ec302 defines the messages sent thanks to the channels as
plain text. This is true for all cases but one: the notification
(e.g. @user). Therefore, the notifications links are broken.

opw-687781
2016-09-06 10:52:53 +02:00
Martin Trigaux 6e61ea2256 [I18N] update saas-12 translations by merging 9.0 and master
Without fuzzy-matching that is too flexible and error prone.
Was matching on wrong source and got translation without '%s'
2016-09-06 10:03:09 +02:00
Damien Bouvy 29d8576b0a [FIX] mail: remove duplicate code
There already is a redirect implementation in the chat_manager
which closely matches the on_redirect implementation in chatter.js,
however the former has the advantage of calling get_formview_id
to ensure that the view is correct.

This fixes a faulty behaviour when some models are referenced from
chatter message using data attribute data-oe-model and data-oe-id.
For example, linking invoices in the chatter would always open them
with the 'vendor invoice' view; from this revision on the correct
view will be used (assuming get_formview_id is implemented on the
model).

The default behaviour of the chat_manager when a user clicks on a
partner record is to open a channel if the partner has a user then
return a callback passed as a parameter (usually to open the channel
as a popup or in the discuss app). To keep the old behaviour
of the chatter followers list widget (i.e. open the partner form
when clicking on a follower), a small change has to be made on the
redirect implementation: when no callback is provided, do not create
the channel (instead a returning an empty callback).
2016-09-06 08:52:57 +02:00
Martin Trigaux e37d0909a2 [I18N] export master source terms
Since the externalidpocalypse
2016-09-05 16:33:43 +02:00
Martin Trigaux 136630c56f [FIX] mail: do not split translations on mail template
This commit is a port of a17c09af to master
The email templates may contain non-html content (mako) which should not be
sanitized.
Changing this attribute to sanitize_attributes made the translations to be split
when translated.
2016-09-05 15:54:01 +02:00
Olivier Dony 859d443863 [IMP] *: rename manifest files for v10 naming convention 2016-09-05 11:57:50 +02:00
Martin Trigaux 3efa9d39c6 [I18N] Update translation terms from Transifex 2016-09-05 11:34:17 +02:00
Odoo Translation Bot 9f0d3800cc [I18N] Update translation terms from Transifex 2016-09-04 00:36:28 +02:00
Raphael Collet 0783318f97 [FIX] adapt logger names 2016-09-02 17:28:13 +02:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Thibault Delavallée 6404d50c89 [IMP] mail: unsubscribe partners that bounce on channels
If a partner bounces more than 10 times on a channel, unsubscribe him from the
channel.
2016-09-01 13:30:09 +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 cfc91c06d6 [IMP] mail: avoid adding alias-partner as followers
Having followers having an email address being an alias is rarely a good idea.
2016-09-01 13:27:20 +02:00
Thibault Delavallée 4f9105a4ef [IMP] mail: handle forwarded emails in mailgateway
If the 'To' of an incoming email is an alias on another model we now consider
this emails as a forward to a new alias. A use case for this is an email on
a task that should be considered as an issue and forwarded to another alias.
2016-09-01 13:25:26 +02:00
Thibault Delavallée 0bedc14c12 [IMP] mail, various: send email to assigned people
When a user is assigned to a model on a user_id field an email is sent to him
containing a link to the document. This way the user is warned he is now
responsible of the task / issue / lead / ...
2016-09-01 13:24:27 +02:00
Thibault Delavallée 38e181ee2c [IMP] mail: send email notifications after transaction commit
Using after commit event notifications emails are now send once the current
transaction is finished. This allows having issues with emails being sent
while the transaction failed sometimes after email sending, but still in the
same transaction.

A small hook is done to allow invitation emails to be sent directly as some
data related to mail.message is unlinked directly in the wizard.
2016-09-01 13:22:59 +02:00
Thibault Delavallée 029d1baf35 [REF] mail: remove required alias on users
This commit remove required alias on res.users model. It also removes the
inheritance of mail.alias.mixin. The field alias_id is kept and allow people
to use aliases on users if they want. However there is no default void alias
created for each user anymore.

Default from of mail.message does not use user alias anymore. Indeed this
creates issues with aliases not being correctly configured and can be
confusing compared to private channels. Using user aliases is therefore
now done manually instead of being a default behavior.
2016-09-01 13:19:24 +02:00
Thibault Delavallée 9c1af690d5 [IMP] mail: bounce management
Handle bounces using bounce alias directly in mailgateway. Previously bounces
were used only in mass mailing to update campaign statistics. Now the
mailgateway tries to find data from standard delivery status emails. This
data is used to update state of emails sent to customers, to display it in
the Chatter. It is also used to increment the message_bounce counter on the
bounced partner and bounced record, if any and if the field exists.

Previous more generic code that detect bounces is kept. This code is more specific
to standard delivery failure notifications by parsing its content.
2016-09-01 13:11:49 +02:00
Thibault Delavallée 72dfcae2a4 [IMP] mail: improve notification management for customers
Currently it is impossible in Discuss to know whether an email has been sent
to a customer and whether it failed or bounced. A notified partner has an
entry in the needaction m2m table. In this commit we decorate this table to
add fields about the email notification: is an email sent, did it failed, did
it bounce.

This information is kept only for customers. Internal users does not use this
information. Moreover their notification is deleted once the message is read
in the Chatter. This avoids having a notification table that grows quickly.

Chatter now holds a new icon for email details. It allows to know on a thread
status of emails sent to customers.
2016-09-01 12:57:56 +02:00
Thibault Delavallée 2194993763 [REM] mail: remove support of [ID] matching in subject in mail gateway
This is an old compatibility code. It is time to remove it as it is not used
sinces ages.
2016-09-01 12:57:32 +02:00
Thibault Delavallée 0843df213c [FIX][IMP] mail, mass_mailing: improve making of Return-Path alias
Previously Return-Path were composed using bounce_alias-<mail_id>-<model>-
<thread_id> . However this may lead to return adresses not supported by
the incoming mail server. We now form the bounce alias using bounce_alis+
<mail_id>-<model>-<thread_id>. Using a + indicates that the right part of
the address is for information and used to manage the bounce. Only the
left part is used for the email routing, allowing the return email to
effectively land in the alias mailbox.
2016-09-01 12:57:05 +02:00
Thibault Delavallée 6aebdc2ab6 [FIX][IMP] mail: check for rcptto when finding destination aliases
When a new answer comes in a thread the mailgateway finds if the recipients
are linked to existing aliases. This allows notably to check if the author
can effectively contact this alias. Previously only the To was checked.
However we cannot ensure the recipient is contained in To as it could be
in Delivered-To for example. We now check for all possible recipients.
2016-09-01 12:50:14 +02:00
Thibault Delavallée 0028c42136 [CLEAN] mail: clean mail gateway code
The purpose of this commit is to clean a bit the code related to email
routing in the mailgateway: message_route and message_route_verify.

message_route is now clearly separeted into two categories. First one
handles emails considered as answers to existing threads. Second one
handles emails that have to create new threads, either through alias or
default behavior of the mailgateway.

message_route_verify has been a bit facotrized to simplify the various
overrides that appeared lately in the codebase.

This commit only contains code cleaning. No functional change should occur
due to this commit.
2016-09-01 12:23:14 +02:00
Thibault Delavallée b259eb69d2 [CLEAN] mail, tools: factorize decode email tools
mail.mail and mail.thread have methods to decode headers. This commit
move them in mail tools. It is indeed simplier to have all email tools
in the same file. Moreover they have been renamed to avoid confusion
with standard library methods: decode and decode_header already exist.

 * decode in mail_message is now decode_smtp_header
 * decode_header in mail_thread is now decode_message_header

A method to data from references is also moved into tools. A regex was
already defined in tools. Now the method using it is already put in tools.
Mailgateway will now simply call this method.
2016-09-01 10:41:04 +02:00
Thibault Delavallée ea4c4a22c4 [IMP] mail: clean test about forwarded emails and parent_id
Previous version of the test was actually not correct. Mailgateway was not
considering references as in-reply-to when trying to find answers that have
to be considered as a new thread instead of an answer to an existing thread.

Purpose of the test is actually to be sure that answers considered as a new
thread have no parent_id set. Otherwise you may have threads linked to
messages belonging to other records, leading to access right issues. Moreover
if this email begins a new discussion thread it makes no sense to have a
parent message set.

A new test is written to better simulate the test case. It sets a message_id
containing reply_to which is the way odoo uses to indicated that answers
to a message have to be considered as new threads. This is used notably in
mass mailing for example.
2016-09-01 10:20:32 +02:00
Raphael Collet ff5e44d2de [REM] models: remove _all_columns 2016-08-31 17:21:45 +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
Thibault Delavallée 97425bfe3f [REF] various: make mako mail templates more xml compliant
As we will soon improve the sanitizer we will be able to sanitize email
templates body. However this implies some cleaning in the templates to
be sure mako is not considered as invalid html / xml and therefore removed
from the template body.
2016-08-30 15:54:55 +02:00
Martin Trigaux 9bbdec5dc9 [FIX] update saas-10 translations by merging 9.0 and master
using the --uses-first parameter on msgmerge this time
2016-08-29 15:35:58 +02:00
Odoo Translation Bot e9bd2aad98 [I18N] Update translation terms from Transifex 2016-08-29 11:14:01 +02:00
Christophe Simonis f4738e7bb5 [MERGE] forward port branch saas-12 up to 78e9c7f 2016-08-26 18:06:17 +02:00
Christophe Simonis de0d503421 [MERGE] forward port branch saas-11 up to f0c8224 2016-08-26 16:59:45 +02:00
Martin Trigaux f0c8224175 [FIX] update saas-11 translations by merging 9.0 and master
using the --uses-first parameter on msgmerge this time
2016-08-26 15:19:04 +02:00
Christophe Simonis 717a4a51a5 [MERGE] forward port branch saas-10 up to 7a4116c 2016-08-26 14:57:43 +02:00
Martin Trigaux a120803843 [I18N] export master source terms 2016-08-26 12:46:48 +02:00
Christophe Simonis 5c2025a3af [MERGE] forward port branch 9.0 up to c578fb7 2016-08-25 18:23:47 +02:00
Nicolas Martinelli f30ec3022e [FIX] mail: link in livechat
When a user sends a link thanks to the livechat, the link is not
clickable is the recipient is on the frontend (e.g. visitor of the
website). On the other hand, a link sent from the frontend to the
backend works.

This is because the message is sent as "html" from the backend,
therefore no link conversion is done during the post-process of the
massege (method `message_post`).

Note that a link sent and received in the backend works because
additional formatting is done (convert emojis, add links...).

opw-686063
2016-08-24 11:25:34 +02:00