Commit Graph
5519 Commits
Author SHA1 Message Date
Thibault Delavallée 856335ddb4 [REV] mail: remove unnecessary override to add filter in JS
This reverts commit 96b9d28351.
2017-03-06 12:04:43 +01:00
Thibault Delavallée 3ae9029732 [IMP] mail: add filter to see explicit mentions 2017-03-06 12:04:43 +01:00
Thibault Delavallée 97e6443089 [IMP] mail: improve default recipients computation
When computing default recipients to mail on some records, take into
account models having a partner_email field. Indeed this method checks
for some commonly-used partner or email fields to find recipients.
This allows to avoid having custom methods in each model. This commit
adds support for partner_email email field used notably in event and
track management.
2017-03-03 13:02:25 +01:00
Mahendra barad 26940f8de4 [IMP] mail: remove duplicated logs when scheduling activities and improve template
Currently when scheduling activities, duplicate logs are created. Indeed
a message is posted when scheduling an activity, editing it and marking it
as done. This leads to a lot of noise being created on records.

This commit remove logs when scheduling and updating an activity. A sole
message is posted when the activity is marked as done.

Scheduled activity display in chatter is also improved to better
differentiate the user creating the activity from the user who is
assigned to the activity.
2017-03-03 11:40:50 +01:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Christophe Simonis eddefc9948 [MERGE] forward port branch 10.0 up to 8c55e57c7f 2017-03-01 16:14:41 +01:00
Christophe Simonis b150ac3203 [FIX] mail: add menu entry for editing activity types 2017-02-28 15:57:04 +01:00
Raphael Collet 1119fdd8a3 [IMP] mail: reflect inheritance of mail.thread on ir.model (#15107)
The boolean field `is_mail_thread` on `ir.model` allows to create custom models
that inherit from model `mail.thread`.  The selection field `track_visibility`
on `ir.model.fields` allows to add tracking on custom fields.

Also change the order on model `ir.model` to make mail thread models appear first.
2017-02-28 10:49:02 +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
Thibault Delavallée 58a4bfd973 [IMP] mail: update message_new to return the newly created record not just its id 2017-02-27 10:00:46 +01:00
Odoo Translation Bot c224df04a5 [I18N] Update translation terms from Transifex 2017-02-26 04:31:11 +01:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Martin Trigaux 773a631a77 [FIX] mail: remove comma
The email content was a tuple instead of a proper string.
Introduced at 0028c421

Fixes tw:jaynvora/status/834435897554710528
2017-02-23 14:01:02 +01:00
Raphael Collet b3c97f08bb [FIX] mail: when initializing aliases, force reflection of models 2017-02-22 15:24:06 +01:00
Thibault Delavallée e2f22fed53 [MERGE] mail: clearly separate email from inbox notification management
This merge changes the way odoo handles notifications. Previously
notifications were sent to the odoo inbox and forwarded by email
depending on a parameter on the partner. Now users choose whether to
use odoo inbox or email but not both. Customers only work using
emails from now on.

This merge also features side commits linked to notifications and mail
like making mail tests less dependent on channels, the removal of auto
read in channels, limitation of assigned emails and project subscription
improvements.
2017-02-21 17:30:38 +01:00
Thibault Delavallée 505aa1aa0c [REM] mail: remove auto read in channels
Currently using channels and inbox notifications is impossible because
browsing a channel marks all related notifications as done. If an user
has a lot of pending notifications, he cannot go on a channel linked to
documents he is working on. Indeed in that case he looses all notifications.

Auto-read of notifications is therefore removed. The only way of managing
notifications when working by inbox is either in the inbox menu or either
on documents, as reading a document marks related notification as done.
2017-02-21 16:44:04 +01:00
Thibault Delavallée bda3d214d1 [IMP] mail: limit "assigned" email to people asking to receive emails
Indeed people working with inbox should already see a notification in
their Inbox.
2017-02-21 16:43:42 +01:00
Aline Preillon 2950ffaa86 [IMP] mail: improve notification management, either email either inbox
Currently partners have a boolean field to choose whether to receive
notifications only in their Odoo inbox or to receive them in their inbox
and by email. This leads to several issues :

 * if a customer is configured to not receive emails he will not receive
   any notification on sales orders, leads, ... This is not clearly
   indicated to the salesman and it is not easy to know how to change
   that behavior
 * if an user chooses to receive emails and does not use its inbox a lot
   of notifications stay in Odoo. The user has to manually set them as
   done to make them disappear which is redundant.

This commit changes that behavior. From now on customers will always
receive all notifications by email. Indeed Odoo is not a customer oriented
mailbox. Moreover sales orders or discussions on leads send to customers
should always be sent by email as it is the standard communication
mechanism. Users will be able to choose to receive notifications in Odoo
or by email. The choice is no longer inbox or inbox + email, but inbox
or email. Choosing one option or the other one depends on the way the
user wants to work.

Technically the field is moved on the users model and selection keys
are renamed. Notification process is modified

 * notified_partner_ids contains as before specified recipients as well
   as followers matching the subtype
 * customers and users working with emails are notified. During that
   process customers notifications are marked as done to be able to
   track the email state without having needaction. Users notifications
   are currently deleted as we do not track their email state.

The removal of partner field implies changes in various addons that
define partner data with this field set in the values.
2017-02-21 16:42:11 +01:00
Thibault Delavallée eb3a531666 [IMP] mail: small code linting in notification methods
This commit cleans code to separate recipients computation in mail
message from notification mechanism in partner. There is no functional
change. Some variables have been renamed notably to know that
some of the record sets are sudoed during computation.
2017-02-21 16:41:15 +01:00
Thibault Delavallée 927fbe8845 [IMP] mail: make tests less dependent on mail.channel model
Currently almost all mail tests run on mail.channel model. Indeed it is
the only model inheriting from mail.thread and mail.alias when having only
mail installed. However channel model have several specific features and
is not totally a standard mail.thread model. For example notification
recipients are computed a bit differently.

Since 4f9105a4ef mail module has a test
model allowing to perform tests on a very simple mail.thread-like model.
This commit make mail tests use this test model instead of mail.channel
everywhere it is possible. Channel model should be used only when tests
are channel-dependent.
2017-02-21 16:41:14 +01:00
qsm-odoo c5779ec30d [REF] *: replace uses of "<>" in xml domains by "!=" 2017-02-21 13:33:32 +01:00
Thibault Delavallée 80d26e26bb [IMP] mail: notify author of internal notes when replied through gateway
Currently if an user mentions someone in an internal note he is not
notified of any reply as replies create internal notes. This commit
ensure the author of the first note is notified of the reply even
if it is still an internal note.

Tests have been updated accordingly.
2017-02-21 10:39:43 +01:00
Thibault Delavallée 1d9052fc19 [IMP] mail: add tests about replies to internal note through mailgateway
Replying to internal notes should create internal notes and should
not notify anyone. Future commit will change that behavior. This
commit ensure the current behavior is working as intended.
2017-02-21 10:39:43 +01:00
Thibault Delavallée 21720f0a3f [FIX] mail: slighty improve notification email layout
* Limit company image to match buttons size and avoid badly
   sized image
 * Add a margin below internal note notice because it currently
   overlaps with actual email content
 * Avoid having signature direclty included in message by
   enclosing body in a div
2017-02-21 10:39:42 +01:00
Odoo Translation Bot 2ab080bcae [I18N] Update translation terms from Transifex 2017-02-19 04:30:24 +01:00
Christophe Simonis d88b95969c [FIX] mail: manage Environment before using it
This is needed for crons that happen to send notifications. Without it,
the email sending was delayed until the `process email queue` cron run.
2017-02-15 14:50:58 +01:00
Martin Trigaux 9a0aaa9e88 [I18N] export saas-14 source terms 2017-02-15 11:40:28 +01:00
Nicolas Martinelli 76e0cb3e95 [FIX] mail: do not update count if message in no channel
When a message is not part of any channel, the message counter is
incremented while the message won't appear in any channel. This leads to
an inconsistency between the number of messages displayed in the status
bar and the actual messages in Discuss.

opw-706884
2017-02-15 09:29:14 +01:00
Denis Ledoux 41ffb5032b [FIX] mail, sale, account: company used in notification emails
The `user` variable in the mail templates is the `self.env.user`,
https://github.com/odoo/odoo/blob/10.0/addons/mail/models/mail_template.py#L370

which will always be the administrator in the use case
of a notification email
https://github.com/odoo/odoo/blob/10.0/addons/mail/models/res_partner.py#L151-L156

Using `user.company_id` to determine the company of the sales order
or the invoice is therefore wrong, as it will always be the administrator
company, which can be different than the order/invoice company.

opw-706267
2017-02-13 15:18:23 +01:00
Nicolas Martinelli 7b74046200 [FIX] mail: action button translation
- Install a language other than English, set it to your user.
- On any model, send a message  (the recipient should be a user, not a
  simple portal user).
- The recipient receives a notification with a primary button half
  translated, for example "Vue Task".

When the call is performed to method `message_post`, the sessioon
context is not added to the RPC request. Therefore, when the model name
is read (method `_message_notification_recipients`), it is done in the
default language.

Note that this is the case for any RPC request using the `call` JS
function.

opw-707678
2017-02-13 08:45:27 +01:00
Odoo Translation Bot 4669c103cc [I18N] Update translation terms from Transifex 2017-02-12 04:30:17 +01:00
Christophe Simonis a282d4ae7f [MERGE] forward port branch saas-14 up to be9dfb331f 2017-02-10 18:41:06 +01:00
mmo 33b09d0d5e [IMP] generic: Open external links in a new tab by default
Purpose
=======

External links in the data sometimes open in the same tab, the users loses times as he has to come back (and looses the context).

Specification
=============

Any external links in data (planners, settings) should open in new tabs.
2017-02-10 14:29:29 +01:00
Nicolas Martinelli d2b9e8aa03 [REF] base, mail: use new format_date method 2017-02-09 15:15:59 +01:00
Odoo Translation Bot 17f3185994 [I18N] Update translation terms from Transifex
after API rate limit reached
2017-02-07 17:01:49 +01:00
Aaron Bohy 9fb68e6c96 [FIX] mail: Activity widget: undefined model
Former implementation tried to retrieve the model in the 'model' and
'res_model' attributes of the widget, but both of them were undefined.

The model being required for some of the RPCs performed by the widget,
there were bugs (e.g. the messages weren't refreshed after the creation
of a new activity).
2017-02-02 14:27:32 +01:00
Christophe Simonis 6a942a9e96 [MERGE] forward port branch 10.0 up to 8a0151b4bc 2017-02-02 12:42:51 +01:00
Nicolas Lempereur 8a0151b4bc [FIX] mail: unhide relevant "Odoo Session Expired"
With how the chat manager was currently started, the "Odoo Session
Expired" could cause an arcane js error which would overshadow it.

This is caused by doing an RPC request too soon which invalidate the
session too soon which disable web client `show_application`.

With this commit, we have the error message "Odoo Session Expired"
instead of:
 "Uncaught TypeError: Cannot read property '$el' of undefined"

closes #15313
opw-706346
2017-02-02 11:23:30 +01:00
Olivier Dony aca34baba8 [FIX] mail: fix cardinality issues in bounce processing
A couple of places in the processing of bounces only
accepted a single matching partner. But there could
be multiple partners matching an email address, and
we should handle them all.

There might also be no matching `bounced_thread_id`
matched by the regex, so we should guard against a
bounced_thread_id == None.
2017-01-31 19:21:56 +01:00
Odoo Translation Bot 6a7c05112b [I18N] Update translation terms from Transifex 2017-01-29 04:30:19 +01:00
Christophe Simonis dbbd7f1178 [MERGE] forward port branch saas-14 up to 7b2924253b 2017-01-25 16:36:28 +01:00
Christophe Simonis 7b2924253b [MERGE] forward port branch 10.0 up to 7427825790 2017-01-25 16:27:38 +01:00
Nicolas Lempereur 7427825790 [FIX] mail: don't linkify removed mention
If after inserting a mention (eg: `@Guy`) and we eg. backspace and
change it (eg: to `@GuyFawkes`) the `@Guy` mention will still be
linkified but the partner is not subscribed.

This happened because the linkifying was not requiring a space to follow
the mention, but when getting the used mentions (and commands, ...) in
the message they were required (unless the mention was exactly at the
end of the message).

With this commit, a space is always required after a mention for it to
be working.

opw-705267
2017-01-25 15:47:30 +01:00
Christophe Simonis 6a7db30508 [MERGE] forward port branch saas-11 up to f23394b83a 2017-01-25 15:01:29 +01:00
Christophe Simonis 74c6e895f6 [MERGE] forward port branch 9.0 up to 3e31dc0ba4 2017-01-25 13:14:38 +01:00
Christophe Simonis 3e31dc0ba4 [MERGE] forward port branch saas-6 up to 09f7916f48 2017-01-25 13:04:50 +01:00
Christophe Simonis 09f7916f48 [MERGE] forward port branch 8.0 up to 9d535ee2c7 2017-01-25 12:56:42 +01:00
Jairo Llopis 9d535ee2c7 [FIX] mail: check all parameters are set
Since `model` is not a required field, the invalidation may crash when one is
missing.
It should never happen than a mail.message has a res_id but not a model as it
makes no business sence.
However it is possible than a message temporarly misses one of the two, e.g:

```
self.model = False
self.res_id = False
```
will trigger two writes and will crash at the first.

Above code should probably be refactored to have only one write but this commit
fixes a regression introduced at 8f1c2bfc (the above code did not crash).

Closes #15199
2017-01-24 16:56:33 +01:00
Christophe Simonis d87ab049e2 [FIX] mail: require res_model_id on followers
The flag has been forgotten with 94d2b97da4
2017-01-24 16:55:51 +01:00
Nicolas Lempereur f519b98481 [FIX] mail: hidden chatter tooltip can cover content
With 72dfcae2a we have an envelope icon in the chatter with the
information on the sent mail.

When not displayed, the tooltip is hidden using opacity:0 so if
something is underneath it it becomes unclickable.

This commit makes the tooltip disappear in this instance.

opw-705205
2017-01-24 12:49:36 +01:00