Commit Graph
106 Commits
Author SHA1 Message Date
Christophe Simonis 5166fbd21b [MERGE] forward port of branch saas-10 up to 6d51bce 2016-06-28 15:12:06 +02:00
Olivier Dony 949c9ffc3a [IMP] mail: remove useless menu cache invalidation
Rev. 15174e9a70 explicitly
cached ir.ui.menu entries, and required an explicit
cache invalidation when users changed their mail.group
subscriptions (mail.group used to override the ir.ui.menu
search(), cfr e.g. 89e404301b)

The menu search() override is gone as of 9.0, so it's time we get
rid of the unnecessary cache invalidation.
2016-06-21 14:34:39 +02:00
Christophe Simonis dda0d3d62d [MERGE] forward port of branch saas-10 up to baf494c
# Conflicts:
#	addons/hr_timesheet/project_timesheet.py
#	addons/sale_layout/i18n/es_PE.po
#	addons/sale_layout/i18n/hu.po
#	addons/sale_layout/i18n/lo.po
#	addons/sale_layout/i18n/pl.po
#	addons/sale_service/i18n/es_MX.po
#	addons/sale_service/i18n/es_PE.po
#	addons/sale_service/i18n/lo.po
#	addons/stock/stock.py
#	addons/stock/stock_view.xml
#	addons/warning/i18n/es_PE.po
#	addons/warning/i18n/lo.po
#	addons/warning/i18n/ru.po
#	addons/web/i18n/cs.po
#	addons/web/i18n/ja.po
#	addons/web/i18n/lo.po
#	addons/web/i18n/th.po
2016-06-15 12:59:39 +02:00
Christophe Simonis baf494c67b [MERGE] forward port of branch saas-9 up to 1d81bb0
# Conflicts:
#	addons/account_extra_reports/i18n/ca.po
#	addons/account_extra_reports/i18n/fi.po
#	addons/account_extra_reports/i18n/pl.po
#	addons/account_extra_reports/i18n/te.po
#	addons/account_extra_reports/i18n/zh_CN.po
#	addons/account_full_reconcile/i18n/hu.po
#	addons/account_full_reconcile/i18n/pl.po
#	addons/crm/crm_lead_menu.xml
#	addons/crm_claim/i18n/es_PE.po
#	addons/crm_claim/i18n/hu.po
#	addons/crm_claim/i18n/ja.po
#	addons/crm_claim/i18n/pl.po
#	addons/delivery/views/delivery_view.xml
#	addons/product/product_view.xml
#	addons/project_timesheet/i18n/es_PE.po
#	addons/stock/stock_view.xml
2016-06-15 12:40:59 +02:00
Christophe Simonis f9072c789d [MERGE] forward port of branch 9.0 up to bfbe2d6
# Conflicts:
#	addons/marketing/i18n/es_PE.po
#	addons/marketing/i18n/hu.po
2016-06-14 19:27:16 +02:00
Goffin Simon 133490b4d0 [FIX] mail: forum reply shows as 'False'
When posting a comment after an answer in the forum, a mail
was sent to each subscriber with 'Re: False' as title.

In fact the title has to be 'Re:' + the name of the parent
record of this message.

When a mail is sent from the post, a link to access the subject
of the forum must be included in the mail.

opw:679073
2016-06-14 17:40:44 +02:00
Goffin Simon ca8a38d201 [FIX] mail: forum reply shows as 'False'
When posting a comment after an answer in the forum, a mail
was sent to each subscriber with 'Re: False' as title.

In fact the title has to be 'Re:' + the name of the parent
record of this message.

When a mail is sent from the post, a link to access the subject
of the forum must be included in the mail.

opw:679073
2016-06-14 14:44:58 +02:00
Denis Ledoux 3ddb446b3b [FIX] crm, mail: Convert to opportunity in mail notification
The button "Convert to opportunity" in the mail notifications
sent when posting a message on an opportunity just coudln't
work as it attempted to call the `convert_opportunity`
method without one of its required method parameter.

opw-680017
2016-06-08 17:15:15 +02:00
Christophe Simonis ac5023060c [MERGE] forward port of branch saas-10 up to 2f948c7 2016-06-08 12:19:23 +02:00
Christophe Simonis e54fb3eb22 [MERGE] forward port of branch saas-9 up to 30864b6 2016-06-03 12:33:58 +02:00
Christophe Simonis a36f6dbc29 [MERGE] forward port of branch 9.0 up to 928bc26 2016-06-02 15:12:47 +02:00
Nicolas Lempereur bc34fe481d [FIX] mail: don't reset subscriptions before adding one
When posting on a thread the user can be auto-subscribed to its default
types. But if the user has previously been subscribed to other subtypes,
those are lost.

With this commit, user mentionned (@{username} in message) or added as
follower for default subtypes are not subscribed if they were already
followers of the record.

So if default subtype is "Comment" and user was only following subtype
"Alarma!" (by checking it and then un-checking "Comment"), then if the
user comment:

-> before this commit, the user would then follow subtype "Comment" and
   not follow anymore "Alarma!"

-> after this commit, the user would follow the subtype "Alarma!"

closes #12008
opw-669127
opw-673766
2016-05-27 12:00:47 +02:00
Christophe Simonis 2dcbdd0778 [MERGE] forward port of branch saas-10 up to bb8f0f1 2016-04-25 15:48:31 +02:00
Christophe Simonis bb8f0f1fc3 [MERGE] forward port of branch saas-9 up to 4d337f7 2016-04-25 14:43:44 +02:00
Olivier Dony ee804e1d32 [MERGE] Forward-port 9.0 up to 74d8cbc190 2016-04-21 18:05:14 +02:00
Olivier Dony 74d8cbc190 [FIX] mail: fix bounce email addressing
- The "From" should not be the administrator user but
  the postmaster/system, and should be an address that
  ignores double-bounces. Using the default bounce
  email accomplishes both.

- The "To" recipient should be the "envelope from"
  sender when available, usually as provided by
  the "Return-Path" header set by the upstream MTA.
  If not present, fall back to the "From" of
  the original email.

- adapt tests to verify the behavior wrt Return-Path
2016-04-21 17:26:45 +02:00
Mansi Gandhi be232e69da [REM] mail: subtype dropdown in chatter
The possibility to choose a subtype when logging a note was added with the
activities mechanism in CRM. However as the user should not use the chatter
but a dedicated wizard in order to do this, the dropdown is removed.

The internal subtype mechanism is kept. Only the possibility to log something
else than a note through the chatter UI has been removed.
2016-04-19 15:25:51 +02:00
Thibault Delavallée f5772c5e8d [FIX] mail: fix issue when processing several CIDs having the same file name 2016-04-14 14:03:55 +02:00
Christophe Simonis 6e95659a08 [MERGE] forward port of branch saas-9 up to f4d1adc 2016-04-01 18:51:55 +02:00
Denis Ledoux 17f4d22594 [MERGE] forward port of branch saas-7 up to 2d2028a 2016-04-01 11:26:27 +02:00
Thibault Delavallée 3b26d1e2fd [FIX] mail: default reply to with multiple alias
When having multiple aliases matching a record, take the first one coming
in the order instead of the last one. This way the defined order is effectively
taken into account.
2016-03-25 12:40:46 +01:00
Thibault Delavallée f4481ff74e [IMP] mail: gateway: CIDs
Finally add support of CIDs in incoming emails. Inline images are recognized
and added as attachments. Image links are updated from src=cid: to src=link
using the /web/image controller.

It has been decided to keep the image in atttachments instead of putting them
in base64, like proposed in various PRs. Indeed we prefer to store this data
into the attachments instead of directly putting it in the mail_message table.
Moreover this enable the display of attachments in the chatter and record views.
2016-03-03 15:56:09 +01:00
Thibault Delavallée ba74e9ffec [CLEAN] tools, mail: remove html_email_clean
Remove html_email_clean in tools. Remove shorten in mail.
2016-03-03 15:44:57 +01:00
Christophe Simonis 60c9cac46b [MERGE] forward port of branch saas-9 up to 87a01c7 2016-02-17 18:07:21 +01:00
Christophe Simonis 87a01c75ef [MERGE] forward port of branch saas-7 up to 5be43b8 2016-02-17 18:01:11 +01:00
Denis Ledoux 26d6e83881 [FIX] mail: specific message subscribe
`write` expects a `dict` for the `values` argument,
`part[record.id]` is a list of commands to add new
followers.

See the returned variable `specific` of the method
`_add_follower_command` in `mail_followers.py`.

Surrounding `part[record.id]` with a `dict` with
`message_follower_ids` has probably been
forgotten by oversight.

`gen` and `part[record.id]` have actualy the same
syntax, and the `write` done with these variables
should therefore be called the same way.

opw-669376
2016-02-12 13:54:05 +01:00
Christophe Simonis 9a805c90ed [MERGE] forward port of branch saas-9 up to d70fde0 2016-02-10 18:40:56 +01:00
Christophe Simonis d70fde0330 [MERGE] forward port of branch saas-7 up to cab5c48 2016-02-10 18:37:01 +01:00
Yannick Tivisse 0b7990cbce [FIX] mail: put only employees into the group_data 'user'
Before, every user was set into this group. It means that a portal
user received elements in his mail context, like the buttons to
open a document or to follow it. Now, only the employees will
receive this kind of information
2016-02-08 15:40:24 +01:00
Thibault Delavallée 82e60a9648 [FIX] mail: automatic subscription of responsible
Do not erase existing subscription with void subtypes.
2016-02-08 12:16:58 +01:00
Aaron Bohy bc2d86e00f [FIX] mail: correctly compute unread messages
Two problems occured:
 - when the user hadn't seen any messages of a channel, the seen_message_id
   was null and doing seen_message_id < msg.id to retrieve all messages
   received after the last one seen didn't return any message (null < x is
   always false)

 - messages sent by visitor on the livechat doesn't have any author_id, so,
   again, doing msg.author_id != partner_id is always false, and as a
   consequence, server-side, the messages sent by visitors were always
   considered as read
2016-02-08 08:29:52 +01:00
Christophe Simonis 04416a5a6f [MERGE] forward port of branch saas-9 up to 469e04e 2016-02-02 14:55:52 +01:00
Christophe Simonis 2611a8198e [MERGE] forward port of branch saas-7 up to e765569 2016-02-02 14:48:31 +01:00
Thibault Delavallée 9b43a8c8f6 [ADD] mail: send email based on templates
When performing automatic tracking it is now possible to automatically send
emails based on a template. This template can either be a qweb template
using its xml_id or a MailTemplate using its record.

This is simply implementing directly in the mixing a feature already present
in recruitment and soon to be added in task, issues or helpdek.
2016-02-01 12:13:53 +01:00
Aaron Bohy 4bab99bdaf [FIX] mail: don't notify 'join/left' messages
Messages of type 'notification' and whose model is 'mail.channel' are
considered as 'system notifications'. This is the case of 'join/left' messages.
They aren't taken into account when computing unread messages anymore.

Also use the same heuristic to decide whether or not to display the message's
star, so from now on pure notifications (not system notifications), like status
change on a document, can be starred.
2016-02-01 11:31:09 +01:00
Christophe Simonis 1231585df1 [MERGE] forward port of branch saas-9 up to 78d20b5 2016-01-27 12:27:01 +01:00
Christophe Simonis 7e44ddcda3 [MERGE] forward port of branch saas-7 up to 6f923cb 2016-01-27 12:23:09 +01:00
Aaron Bohy 6cc8d32d60 [FIX] mail: automatically consider messages sent as read
Problem was that since rev. 617968c61, we consider sent messages as read client
side. This has been done to avoid to indicate that a channel has unread
messages e.g. when this channel is a follower of a chatter in which we wrote
a message.

This change has as consequence that we don't perform the 'channel_seen' RPC for
messages sent. At each refresh, the server sends information about pinned
channels, especially the unread counter, which was thus sometimes incorrect.

This rev. simply doesn't take messages we wrote into account when computing
the message_unread_counter field.

Also correctly display the 'New messages' separator in threads, by automatically
skipping messages we wrote (i.e. it is now displayed above the first message m
with m.id > last_message_seen_id and such that we aren't the author of m).
2016-01-25 15:46:55 +01:00
Martin Trigaux 4dd7187a7a [FIX] mail: translated mailing_model
_mail_mass_mailing attribute is evaluated at server launch (with no context) so
the attribute is never translated.
Create a new method in mail_thread to translate again the term at evaluation but
with a correct context.
Thanks to the _(...) in the attribute definition, the proper term is exported
and present in .pot file.
2016-01-15 12:00:42 +01:00
Thibault Delavallée c61dc5cb36 [IMP] mail: encapsulate _message_track in batch
_message_track is encapsulated in a method that calls it in batch. The purpose
is to ease the tracking to work in batch. Moreover future improvements in mail
will use this method and will be able to work in batch.
2016-01-14 15:54:01 +01:00
Christophe Simonis 5f997bc4ef [MERGE] forward port of branch saas-7 up to 7fa6f73 2016-01-12 16:11:28 +01:00
Thibault Delavallée a69c2bab0a [FIX] mail, mail_channel: recipients of channels
Mailing lists (mail.channel) should not send specific notification emails.
Indeed there can be a lot of recipients and customizing each email can
take time to compute. This leads to posting a message on a mail.channel
being very slow.

It is now possible for a model to customize the notification email
recipients computation. The first use is to ensure that mail.channel
encodes recipients using email_to instead of recipients_ids. This way
less processing is performed on notification emails.

This is a manual cherry-pick of commit d4a1eb4435
that was not forard ported. Mail has indeed evolved since 8.0 and its
forward port was not an easy task.

This commit also includes the fix of mail.channel recipients. All are now
considered as equal and receive a simple notification email. No distinction
is done between partners and users. The notification emails for channels
should be as simple as possible.
2016-01-08 16:40:40 +01:00
Géry Debongnie 739301be09 [FIX] mail: add link to urls clientside, not serverside
the server should avoid as much as possible modifying emails.  Adding
links is a presentation concern, so this commit moves this logic client
side.
2016-01-08 15:02:22 +01:00
Martin Trigaux e4bf03aeaf [MERGE] Forward port of branch saas-7 up to c298cf3 2015-12-21 11:37:53 +01:00
Martin Trigaux c298cf3250 [MERGE] Forward port of 9.0 up to 7892d99f 2015-12-18 16:15:08 +01:00
Aaron Bohy 17896a92da [FIX] mail: various ui improvements/fixes
* chat windows:
  - input was kicked out of the window on chrome 43
  - don't animate if folded by default (e.g. after a refresh)
  - width and height 100% like in the frontend
  - z-index to make sure that they are over bootstrap active btn,
    but below notifications, and modals

* chatter:
  - internal note: send button renammed to 'Log'
  - send button is the first button again
  - remove annoying form view widget's tooltip

* client action: focus on composer on channel change
2015-12-15 10:01:21 +01:00
Olivier Dony 3d32e99665 [FIX] mail.thread: optimize lookup of res.users by email
Searching on res.partners with domain [('user_ids' , '!=', False)]
will currently be translated into a huge "ID IN <...>"  query,
with the IDs of all existing users.
On a database with a lot of users, this can be measured
in seconds (e.g. 3-4 seconds with 500k+ users),
leading to significant delays in email delivery.

Using a direct lookup in res.users is more direct and faster.
2015-12-10 18:43:17 +01:00
Christophe Simonis 82a495eed5 [MERGE] forward port of branch saas-7 up to 4022493 2015-12-10 13:05:58 +01:00
Christophe Simonis 4022493c0b [MERGE] forward port of branch 9.0 up to da2b88b 2015-12-09 16:44:05 +01:00
Thibault Delavallée f7c0480dc1 [FIX] mail: fix 504227cca9
Do not restrict followers-based alias to members of non public channels.
Otherwise you may have issues defining a public mailing list with a
subscription step. People still wouldn't be able to post on a public
channel using a restricted alias.
2015-12-09 09:59:04 +01:00