Commit Graph
4757 Commits
Author SHA1 Message Date
Aaron Bohy fc42880da2 [FIX] mail: restrict mention suggestions to channel members
Problem is that when someone is mentionned in a channel he doesn't belong to
(public, private or DM whatever), the message only appears in its Inbox and
he can't know where it comes from nor reply. This is thus very confusing.

With this rev., in Discuss, one can only mention members of the channels.
In the chatter, anyone can be mentionned like before, as when the message
arrives in the Inbox, there is a link to the associated document.
2016-01-25 15:46:56 +01:00
Aaron Bohy da2cbae8f8 [FIX] mail: synchronize last_message_seen_id between tabs
When using multi tabs or browsers, the 'New messages' separator in threads was
sometimes wrongly displayed (displayed over messages already seen in another
tab or browser).
2016-01-25 15:46:56 +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
Aaron Bohy f35b48aa90 [FIX] mail: don't erase textarea's content on 'New message' click
Also mute the 'New message' button when the composer is open as the only
primary action should be to send the message.
2016-01-25 15:46:55 +01:00
Aaron Bohy 302885b860 [FIX] mail: various ui fixes
- limit partner search to 10 in new message's chat window to prevent overflow
- prevent negative needaction counters (may occur in multi-tab, with
  needactions received during an inactivity period)
- remove <pre> tag when computing messages' preview for the messaging dropdown
  as they break the layout and add 'overflow: hidden' on o_mail_channel_preview
  just in case
- rename 'New message' button in Inbox into 'Send mail' as it was confusing,
  and adapt .pot file accordingly
- focus on composer when opening a chat window
- break lines in threads to avoid horizontal scrollbar (credit goes to qsm)
- correctly apply rules on <p> in threads

opw-667235
2016-01-25 15:46:55 +01:00
Odoo Translation Bot 6a6827e85b [I18N] Update translation terms from Transifex 2016-01-24 00:33:22 +01:00
Goffin Simon dc02f773ce [FIX] mail: onchange_template_id
When using context action for a template, the report was not shown in
the compose message as an attachment.

opw:657152
2016-01-21 14:36:20 +01:00
Odoo Translation Bot 78a0a60b08 [I18N] Update translation terms from Transifex 2016-01-21 06:31:45 +01:00
Géry Debongnie 8af3841cb2 [FIX] mail: prevent mail to rejoin a channel that we just left
sometimes, the web client receives unsubscribe notification and an extra
notification on that channel.  This is then followed by an attempt to
rejoin the channel that we just left.  This commit prevents that
situation to occur.

For that, it needs to know the notifications received by the bus in one
batch, not one at a time.
2016-01-20 14:41:34 +01:00
Nicolas Lempereur 6dde919bb9 [FIX] mail: don't autoescape mail subject
The mail template rendering system use "autoescape" for subject, body,
email_to, ...

Using autoescape is good for the body, but for the subject it means
variables insertions have to be marked as safe.

This commit add another environment without autoescaping enabled for the
subject field.

From https://tools.ietf.org/html/rfc2822:

  The "Subject:" and "Comments:" fields are unstructured fields as defined
  in section 2.2.1, and therefore may contain text or folding white space.

  2.2.1. Unstructured Header Field Bodies

  Some field bodies in this standard are defined simply as "unstructured"
  (which is specified below as any US-ASCII characters, except for CR and
  LF) with no further restrictions.

closes #10547

opw-659231
opw-666801
opw-665863
2016-01-20 14:13:56 +01:00
Géry Debongnie 44ac7903cc [FIX] mail: prevent crash when interacting with inactive partner
when a user is disaninactivated, it makes sense to disaninactivate his/her
corresponding res_partner.  This had the unfortunate effect of changing
the result of the channel_slot call for the direct messages with this
user.  As a result, the discuss interface was not happy.  This commit
does what it needs to keep the discuss interface happy.  That's what we
want, right?
2016-01-19 16:25:35 +01:00
Géry Debongnie e0ea7c04f9 [FIX] mail: fix issue with disappearing filters in some cases
The client action had a weird issue: going back from a breadcrumb to the
client action made the searchview (filters/favorites) buttons disappear.  This
is caused by a weird behavior of the control panel.  This fix is the safest
for now, but working on the control panel behavior would be a better long term
solution.
2016-01-19 14:23:01 +01:00
Odoo Translation Bot fb7064bf3f [I18N] Update translation terms from Transifex 2016-01-17 01:29:24 +01:00
Goffin Simon 8c3eb91e57 [FIX] mail: display block for message body
The message body must be inside a tag div because when the message was short
with a @author, there was no tag div around the body and it was displayed
inine.

opw:666840
2016-01-15 16:51:51 +01:00
Géry Debongnie 59ce9a0ed9 [FIX] mail: composer fixes
- chatter composer did incorrectly send messages when enter is pressed
- add a div around the textareas to prevent rendering issues because of
  flex
2016-01-15 16:33:33 +01:00
Aaron Bohy e5e31a0519 [FIX] mail: heart emoji not correctly replaced
Fixes #10445
2016-01-15 13:18:13 +01:00
Aaron Bohy 7e3c6bd366 [FIX] mail: composer: emojis not displayed in basic composer
Two composers are appended to the client action: a basic composer and an
extended one used in mass mailing channels. Emojis are rendered in a container,
and when the user clicks on the emojis button, this container is shown.

The problem came from the fact that this container has the same classname in
both composers, so for both composers, the emojis were rendered in the same
container, producing an empty container for one of the two composers
(in this case, the basic one).
2016-01-15 13:18:13 +01:00
Aaron Bohy 617968c61b [FIX] mail: don't mark as unread messages we wrote
in the client action (bold channel name in the sidebar)
in chat windows (number of unread messages written in header)
2016-01-15 13:18:13 +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
Odoo Translation Bot c7b01fea24 [I18N] Update translation terms from Transifex 2016-01-15 08:54:52 +01:00
Christophe Matthieu aad21cd555 [FIX] mail: open livechat link in the body message with target="_blank"
opw-666733
2016-01-14 15:02:38 +01:00
Martin Trigaux b3c20265d5 [FIX] mail: .pot changes missing at 94920b4
REDRUM REDRUM REDRUM
2016-01-14 14:13:55 +01:00
Géry Debongnie 30c26d7654 [IMP] mail: various UI improvements
- don't add 'New message from' in the title of notifications when an
  author name is defined
- use a simple O icon instead of the full Odoo logo when a notification
  is natively displayed
- don't scroll to bottom if the thread is not already at bottom
- don't mark a channel read if thread is not at the bottom
- add # in front of channel name in chat windows and in invite dialog
- accept anonymous names in channel (for ex, livechat channels)
- always go to the next line with shift+enter
- always send message with ctrl+enter
- pressing enter sends message or go to next line depending of context
- don't allow to detach mass mailing channels
2016-01-14 11:22:26 +01:00
Aaron Bohy 8397abd871 [IMP] mail: make chat windows somehow usable in mobile 2016-01-14 11:22:26 +01:00
Aaron Bohy 54396cfa41 [FIX] im_livechat,mail: don't automatically detach chat channels
This reverts commit a8239cd as the navbar dropdown recently introduced now
offers a quick access to channels without coming back in the Discuss App.

Moreover, this commit emphasizes the notifications navbar icon when there are
unread messages (or at least, it mutes it when there isn't).
2016-01-14 11:22:26 +01:00
Aaron Bohy 916d90af35 [IMP] mail: open dm shortcut from in navbar dropdown
Allows to directly open a dm channel from a chat window, without coming back
to Discuss.
2016-01-14 11:22:26 +01:00
Aaron Bohy b3868a613c [IMP] mail: needaction/unread messages counters
Some UI changes:
  - Unread messages in chat are now displayed as needactions in the Discuss's
sidebar (badge with counter of unread messages, instead of simply bolding the
channel name).
  - The counter displayed in the navbar is now the sum of needactions and total
of unread messages in chat.
  - The counter displayed next to Inbox is still the needaction counter.

For consistency between tabs/browsers/devices, the channel_seen info is now
broadcasted, meaning that every tab/browser/device will be noticed.

Also now correctly increment the unread counter of a channel if the received
message is a needaction.
2016-01-14 11:22:25 +01:00
Aaron Bohy d93231afe2 [IMP] mail: navbar: messaging menu
The navbar notification is now a dropdown containing a preview of all pinned
channels (except Inbox and Starred), channels with unread messages being on the
top.

It allows to quickly detach a channel without going back to Discuss.

The channels preview fetching is performed only once, and it is done in
background without blocking the whole UI (using shadow option or session.rpc()).

Also fixes a synchronization problem between server and client about the folded
state of channels (the info wasn't stored client side, so it produced weird
situations, e.g. unfolding a channel didn't actually unfold it).
2016-01-14 11:22:25 +01:00
Aaron Bohy 0301735354 [IMP] mail: move 'New message' button from navbar to Inbox 2016-01-14 11:22:25 +01:00
Aaron Bohy 18fccd9d6c [IMP] mail: put chat windows in a dropdown in case of overflow
Former algorithm to display chat windows was pretty basic: each window was
positionned 5 pixels to the left of the previous one, starting from the bottom
right corner of the screen. Thus, when there were too many chat windows to fit
in the screen, they overflowed to the left.

This rev. handles this case by hidding overflowing chat windows and making them
available in a dropdown positionned 5 pixels to the left of the last visible
chat window.
2016-01-14 11:22:25 +01:00
Aaron Bohy 37238d343a [FIX] mail: notifications: strip html tags
but keep jumps to line
2016-01-14 11:22:25 +01:00
Denis Ledoux 94920b43c9 [FIX] *: typo Important Messages -> Unread Messages
While this is important to read the replies
you get in the threads you follow, `Unread messages`
is more accurate to describe what these filters
displays.

opw-666739
2016-01-14 10:48:37 +01:00
Martin Trigaux ce2d94207b [FIX] mail,web: : untranslated term in view
_t(...) in xml qweb views do not work, not exported, not evaluted.
No reason to use t-att-*, just using simple attribute is enough.
2016-01-13 15:48:09 +01:00
Thibault Delavallée fd57dd5713 [IMP] mail: chatter: hide notification buttons
Using some templates it is possible to have odoo buttons directly in the
mail_message body. Hide them in the chatter as this is more noisy than
usefull.
2016-01-13 10:34:09 +01:00
Thibault Delavallée 2bfb880503 [FIX] mail: auto delete
Correctly set the auto delete property coming from the template in the composer.
Set the mail_auto_delete context key for message_post, and directly set the
auto_delete field value in mass mailing mode.
2016-01-13 10:34:09 +01:00
Martin Trigaux bc5e51d6b0 [FIX] mail: missing terms
Please people, stop changing the terms every week...
2016-01-13 10:05:06 +01:00
Christophe Simonis 33299fd689 [MERGE] forward port of branch saas-6 up to 5eee559 2016-01-12 18:46:23 +01:00
Christophe Simonis 5eee5591ab [MERGE] forward port of branch 8.0 up to 37ed5ce 2016-01-12 18:24:27 +01:00
Géry Debongnie 53f4649334 [FIX] mail: use our own autoresize for composer inputs
Instead of duplicating the autoresize logic, we might as well use it for
everything.
2016-01-11 14:32:51 +01:00
Thibault Delavallée 148c1ed51c [FIX] mail: html issue in invite email
Thanks Vitor Fernandes <vmlf01@gmail.com> for pointing it out.
2016-01-11 12:48:09 +01:00
Thibault Delavallée a35d2d5548 [FIX] mail: context propagation
Thanks michaelhwalther <michaelhwalther@gmail.com> for pointing it out.
2016-01-11 12:48:09 +01:00
Géry Debongnie cf294f723f [FIX] mail: prevent double scrollbar with notification bar
when the bar asking for notification permission appears, it can cause
two scrollbars to appear in the client action.  This commit moves the
notification bar inside the chat content, which solves the issue.
2016-01-11 11:00:18 +01:00
Odoo Translation Bot 1c33197828 [I18N] Update translation terms from Transifex 2016-01-10 03:04:15 +01:00
Odoo Translation Bot 9c911d0364 [I18N] Update translation terms from Transifex 2016-01-10 01:28:32 +01:00
Christophe Simonis 499c2b8da5 [MERGE] forward port of branch saas-6 up to 580389a 2016-01-08 18:26:59 +01:00
Christophe Simonis 580389add8 [MERGE] forward port of branch 8.0 up to 7041b25 2016-01-08 17:05:38 +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
Aaron Bohy dfdd38e3b2 [FIX] mail: Discuss: don't suggest to join private channels
Problem was that administrators have access to every channels, even private
channels they are not registered to, because when trying to join an existing
channel, the autocomplete proposed every channels accessible for the user, but
didn't filter private ones.

This rev. makes sure to only suggest non-private channels.

Also prevent '|' domain injection to disable filters (odoo/odoo@44e65e72d3)
by using expression.py to build domain.
2016-01-08 14:32:51 +01:00
Aaron Bohy 0fbc128033 [FIX] mail: followers: subtypes: correctly notify channels
Except for messages, activities on a document like internal notes posted
trigger notifications to partners and channels following the corresponding
activity's subtype.

Rev. 69ed801 rightly re-introduces a filter on followers to prevent notifying
more partners than necessary. Unfortunately, this filter doesn't take into
account channels, which are thus automatically removed from followers to
notify, whatever the subtypes they follow, e.g. internal notes on a document
don't appear in channels following the 'Note' subtype of this document.

This commit makes sure that channels always pass through that filter, but warns
users that public channels should probably not following internal subtypes.

Also makes the edit subtypes dialog html valid (li's must be inside, e.g., ul).
2016-01-08 14:32:51 +01:00