Commit Graph
4895 Commits
Author SHA1 Message Date
Géry Debongnie c5c3ab927e [IMP] mail: load audio file lazily 2016-03-09 13:01:34 +01:00
Géry Debongnie e877d59d21 [REM] mail: remove old announcement bar 2016-03-09 13:01:34 +01:00
Yannick Tivisse f6c0418a80 [IMP] mail: Send plaintext emails on discussion with external user/partner
When there are no available action buttons on the email (as Follow, View Task,
Convert to Opportunity), i.e. when the user/partner is not an employee, and
when the message subtype is 'Discussion', send a plaintext mail instead of
a formatted one.

Use case: Strange to receive a mail like this when you're on a lead and you
receive formatted mails.
2016-03-07 15:55:53 +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
Géry Debongnie a127a7aed2 [FIX] mail: only update timestamps periodically
the messages in a thread were previously rerendered every minutes to
update their timestamps.  This commit only update the timestamps, not
all the message.  This will allow us to keep expanded/folded state in
messages without collapsing them every minutes.

[IMP] mail: add read more/read less support client side

Messages are cleaned up and tagged server sides, with a attribute
data-o-mail-quote.  This commit replace their content with a clickable
read more link, which toggle its display.
2016-03-03 15:45:05 +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
Thibault Delavallée cb8c2d2b7e [IMP] tools: sanitizer: quote detection
Quote detection is now done in the sanitizer itself. It tags nodes that are
inside quotes (signature, text quotes, email quotes). The purpose is to remove
html_email_clean and have all the html cleaning / sanitizing inside a single
function. When a node is tagged, data-o-mail-quote is set on the node.
This attribute is added in the whitelist of valid attributes for the
sanitizer.

[REM] Support of shortening messages. The read more / read less will only
display or hide detected quotes and signatures. Shortening messages above
a given amount of characters is not supported anymore. Indeed it adds much
complexity to the sanitizer without adding much value to the result. The
primary purpose of the sanitizer is indeed to remove noise and unnecessary
content.

[TESTS] a lot of test are not necessary anymore, as read more / read less
display will be moved in the front-end and as the shortening has been
removed.Tests have therefore been cleaned and simplified.

[DEMO] mail: small demo update to include a bit quote detection
2016-03-03 15:44:56 +01:00
Thibault Delavallée fd25fd4d44 [FIX] fields: do not strip class by default
Do not strip class by default on html fields, this was an error. Currently
only mail_message body field should not contain classes. Indeed as external
content can be stored through the mail gateway we do not want to keep the
classes.
2016-03-02 16:43:04 +01:00
Aaron Bohy 27e92415a9 [FIX] mail: followers: allow edit subtypes even if not follower
Before this rev., editing the subtypes of other followers was only possible if
the current user already opened a record of the same model of which he is
himself follower.
2016-03-02 13:39:16 +01:00
Aaron Bohy dc81e5f664 [REF] mail: code refactoring
- extended_chat_window feature in its own files: as it is only available in the
  backend, we don't want it in the frontend assets (which contain the 'basic'
  chat_window)
- move followers feature in its own files
- creation of the 'mail.utils' module in utils.js
- creation of systray.less to define the style of the mail item and dropdown
  in the navbar
- use of chat_manager's search_partner function in PartnerInviteDialog
- some code linting
2016-03-02 13:39:16 +01:00
Aaron Bohy 1e0bc5920f [IMP] mail: follower: remove an RPC when user is follower
When loading a form_view with the follower widgets, an RPC was performed to get
the followers info (name, email...), and if the user is one of the followers,
a second RPC was done to retrieve the subtypes.

This rev. batches those two RPCs. Also simplifies read_subscription_data() as
it is now always called with a follower_id.

A few code refactoring as well.
2016-03-02 13:39:16 +01:00
Fabien Pinckaers 4c8e908b49 [IMP] Speed up app switcher loading: 645k --> 137k lossless compression for all icons 2016-02-26 11:39:38 +01:00
qsm-odoo 58c5ff1d4f [REF] website*: frontend user navbar
* Remove use of bootstrap navbar
* Add navbar.less file for compatibility with enterprise
* Modify the location of the "new page/product/..." elements
2016-02-24 13:47:36 +01:00
Ravi Gohil 7eab8e26d3 [MIGR] base: migrate base/res to the new API
- `ir.property`, improve API of method `get_by_record`
- `res.bank`, `res.partner.bank`
- `res.company`
- `res.config`, `res.config.installer`, `res.config.settings`, fix usage of methods `get_default_`
- `res.country`, `res.country.group`, `res.country.state`
- `res.currency`, `res.currency.rate`
- `res.font`
- `res.lang`
- `res.partner`, `res.partner.category`, `res.partner.title`
- `res.request.link`
- `res.groups`, `res.users`, `res.users.log`, change password wizard
2016-02-23 12:06:25 +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
Christophe Simonis 5be43b8d9a [MERGE] forward port of branch 9.0 up to 27058c4 2016-02-17 17:48:03 +01:00
Géry Debongnie 12d5667830 [FIX] mail: use the domain to determine message to mark as read
The button 'mark all as read' used to mark all messages as read, which
is not usually what the user wants when there is an active filter in the
search view.  This commit make sure that the domain is send to the
server and used correctly.
2016-02-17 14:26:54 +01:00
Aaron Bohy b87b6cc613 [FIX] mail: allow to extend make_message() and make_channel()
to load and display more fields of the corresponding model.
2016-02-16 11:27:11 +01:00
Denis Ledoux 493705bb77 [MERGE] forward port of branch 9.0 up to c40070f 2016-02-15 17:00:11 +01:00
Aaron Bohy 2f58e95a8d [FIX] mail: composer: correctly erase mentions
The problem was that mentions weren't correctly erased with DELETE key (in some
conditions), or when replacing mention text. When this happened, the mention
didn't appear in the message, but the message was even tough sent to the erased
mentioned people.

With this rev., we don't try to detect erasing on the fly anymore, but we
rather validate mentions before sending the message with the content of the
input.

opw 669362
2016-02-15 12:18:44 +01:00
Odoo Translation Bot ee42be5921 [I18N] Update translation terms from Transifex 2016-02-14 00:34:15 +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
Aaron Bohy 26f1d75606 [FIX] mail: followers: can't access res.partner case
When the user can't read the model res.partner, former code tried to determine
whether or not the user was follower of the document. This was wrong for three
reasons.

First, it performed an RPC to get the partner_id of the current user, but this
info is already stored in the session so the RPC was useless.
Second, the partner_id isn't helpful to know if the user is a follower because
everything we have is the follower_ids, which aren't ids of the res_partner
model, but ids of the mail_follower model (compare apples and oranges...).
Third, we anyway didn't use that information at all as the button indicating
whether or not the user is a follower wasn't displayed.

This rev. simply removes that useless RPC and only displays the count of
followers as previously.
2016-02-12 12:10:08 +01:00
Aaron Bohy a4dade389b [IMP] mail: batch RPCs at init
Remove the RPC to retrieve the action_id of the client action as do_action()
can take directly the xml_id, and batch the RPC to retrieve the menu_id with
the initial RPC used to fetch channel slots, emojis...
2016-02-12 12:04:02 +01:00
Aaron Bohy 452bf80aff [IMP] mail: remove 'Send Mail' button in Discuss
as it was more confusing than useful.
2016-02-12 12:04:01 +01:00
Géry Debongnie f201cb5b7e [FIX] mail: various ui improvements
- swap reply-to and mark-as-unread buttons in threads
- remove blockquote from stripped html in channel previews
- readd padding to no-content message in threads, also to no match found
  message
- add 1 to chat window z-index to prevent control panel buttons to show
  through it
2016-02-11 15:49:10 +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
Denis Ledoux c2d230ad68 [MERGE] forward port of branch 9.0 up to 47bb1bd 2016-02-10 15:55:48 +01:00
Denis Ledoux 911112c322 [FIX] mail: announcement bar URl displayed on print
On printing, the announcement bar URL was displayed
in the printing result.
e.g.
`https://services.openerp.com/openerp-enterprise/ab/register/...`
was displayed at the top of the print.

This is related to the revision 50a4ca31f8.

This is due to this simple typo, the according CSS rule was
never applied because of it.
2016-02-10 10:51:13 +01:00
Denis Ledoux a9c9f78ed9 Revert "[IMP] mail: remove deprecated annoucement bar"
This reverts commit 50a4ca31f8.
This causes retro-compatibility issues if you do not
update the `assets_backend` qweb views.

Closes #10853
2016-02-10 10:50:56 +01:00
Christophe Simonis 50a4ca31f8 [IMP] mail: remove deprecated annoucement bar
This bar was never displayed as the remote css was always empty.

When using the enterprise web client, the printing stylesheet show the
target of links (<a> tags) between parentheses, including the one from
the annoucement bar that should be kept hidden.
2016-02-09 16:23:38 +01:00
Denis Ledoux eb2346ba46 [MERGE] forward port of branch 9.0 up to 0b7990c 2016-02-08 16:08:32 +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
Yannick Tivisse 243d207ad6 [FIX] mail: Use standard signature to be recognized by services like Google 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 4010c09e68 [FIX] mail: automatically open DM and livechat on new message
When a new message arrives in a DM or a livechat, the channel is automatically
open in a chat window if we aren't currently in Discuss.

Don't apply this behavior in mobile and we probably don't want to see a full
screen chat window everytime someone sends us a message.
2016-02-08 08:47:10 +01:00
Aaron Bohy ad02d23bf3 [FIX] mail: hide chat windows in discuss
Thus also remove the 'Detach' button in Discuss's control panel as we can now
directly detach channels with the messaging menu.

Also removed unused handler on 'messages_read' since rev. 30c26d7.
2016-02-08 08:29:53 +01:00
Aaron Bohy 5ba53f3b11 [FIX] mail: display user status in chat windows 2016-02-08 08:29:53 +01:00
Aaron Bohy 79a8eeb17d [FIX] mail: unread counter on new message in non pinned DM
When a new message arrived in a non pinned DM, the unread counter was
incremented twice ; once because the channel info (along with its unread
counter) was fetched from the server as the channel wasn't in the JS cache yet,
and once when adding the message in the JS.

With this rev., we only increment the unread counter when a new message arrives
if its channel is already in the JS cache.
2016-02-08 08:29:53 +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
Aaron Bohy 2b43624666 [FIX] mail: don't display subject of messages written in a chatter
This was working fine until rev. 4bab99bd which accidentaly changes the
condition.
2016-02-08 08:29:52 +01:00
Aaron Bohy 377bcd202f [FIX] mail: overlapping calls to get_channel_preview
Problem occured when the first call to get_channel_preview was directly
followed by others, before the channels_preview_def was resolved. In that case,
the other calls all returned an empty array, as only the channels_preview
array was only filled with the RPC result for the first call to
get_channel_preview (the one which initiated the RPC).
2016-02-08 08:29:52 +01:00
Aaron Bohy 021f9aeec7 [FIX] mail: systray items must wait for chat_manager
Those items might have been rendered and inserted into the DOM before the chat
manager initialization was completed. As those items rely on chat manager's
data, they should wait for it before executing their action (inbox redirection
and channels preview display).
2016-02-08 08:29:52 +01:00
Odoo Translation Bot f2146d360d [I18N] Update translation terms from Transifex 2016-02-07 00:33:44 +01:00
Géry Debongnie bc03c915d4 [FIX] mail: various UI fixes
- correct template for undo snackbar
- better padding for chat windows
- recent messages now display 'now' instead of 'a few seconds ago'
2016-02-05 15:23:27 +01:00
Géry Debongnie 9e31b5de2a [FIX] mail: discuss notifications small fixes
- discuss notifications are always sent natively if possible
- clicking on native notifications focus the tab
- clicking on native notifications closes them
- granting notification permissions will display a confirmation
  notification
2016-02-05 14:09:19 +01:00
Olivier Dony d67d24d8b4 [MERGE] Forward-port 9.0 up to 93e8bf8ccf 2016-02-03 17:19:16 +01:00
Géry Debongnie 5465dccd69 [FIX] mail: prevent the composer to break layout in client action
The composer can grow vertically.  It will eventually grow out of the
chat content, which breaks the layout.  This commit fixes the issue.
2016-02-03 14:36:30 +01:00