Commit Graph
46 Commits
Author SHA1 Message Date
Jigar Patel 253d4eccf0 [IMP] mail: Add counter in starred 2016-04-08 13:41:01 +02:00
Aaron Bohy 533da62a6b [FIX] mail: read_followers() doesn't need res_id
When creating a new record, read_followers() was called without res_id and it
produced an error as the argument didn't have a default value. That argument
wasn't used anyway so this rev. simply removes it.
2016-03-16 11:21:34 +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
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
Christophe Simonis 469e04e97c [MERGE] forward port of branch saas-8 up to 2611a81 2016-02-02 14:52:15 +01:00
Denis Ledoux 1fc68ce428 [MERGE] forward port of branch 9.0 up to a842199 2016-01-29 12:55:57 +01:00
Nicolas Lempereur f5fedbcb18 [FIX] mail, portal_sale: conserve action in /mail/view
Methods get_formview_action can be called by sudo() so for knowing the
real user they should prefer context['uid'] to uid.

Without the action `/web` can't figure out that e.g the view we want is
the one for portal user and not the default one.

With this fix, portal user (not in base.group_user) get to the intended
view with the intended menu when clicking on a invoice/sale order portal
mail link. As for other user there is no change.

closes #10681
opw-666260
2016-01-29 12:08:24 +01:00
Christophe Simonis 5ba5172d99 [MERGE] forward port of branch saas-8 up to 8064379 2016-01-07 15:16:56 +01:00
Christophe Simonis 31ce19bd7c [MERGE] forward port of branch 9.0 up to 97e87a4 2016-01-05 15:51:49 +01:00
Aaron Bohy a4ddfe0b28 [IMP] mail: merge chat initial RPCs
Two RPCs were performed by the chat_manager on webclient launch. One of them
was about emojis, and recent messages received in the past 10 minutes in
detached channels. This RPC has been removed as the emojis fetching can be
done in the other RPC (mail/client_action), and the recent messages are not
useful since the refactoring of mail and the introduction of the chat_manager.
2015-12-28 10:05:15 +01:00
Denis Ledoux 5e51dc9924 [FIX] mail: unfollow buttons for portal users
The route `/mail/unfollow` is used by the button
`Unfollow` in the mail notification template so a user
can remove himself from the followers of a thread.

To be able to remove yourself from the followers,
you need to have the write access on the thread
(see `message_unsubscribe` in `mail/mail_tread.py`)
which you perhaps do not have, for instance if you
are a portal user.

The unsubscribe of this follower from the thread
should therefore be done as sudo.

opw-659295
2015-12-23 17:59:36 +01:00
Martin Trigaux c298cf3250 [MERGE] Forward port of 9.0 up to 7892d99f 2015-12-18 16:15:08 +01:00
David Monjoie f6dd8994d6 [FIX] mail: fixed redirect to messaging url
I checked with aab, and action definition comes after # and not ?.
2015-12-14 14:51:27 +01:00
Christophe Simonis 4022493c0b [MERGE] forward port of branch 9.0 up to da2b88b 2015-12-09 16:44:05 +01:00
Yannick Tivisse f6713b420b [FIX] mail: Remove field 'chatter_needaction_auto' from the view as it's not used
anymwhere since the chatter refactor refactoring

It has been removed entirely in master at
https://github.com/odoo/odoo/commit/b278b2c431a1bb06627bbdc285263644049bb3b0
2015-12-02 13:17:04 +01:00
Martin Trigaux 90254beedb [MERGE] forward port of branch 9.0 up to 00ee6e7b 2015-12-01 10:30:44 +01:00
Aaron Bohy db8203c27a [FIX] base,hr,mail: prefetch mention suggestions
The purpose of this commit is to improve the overall performance of the mention
mechanism of the client action and chatter composer, by pre-fetching some data.

First, the employees are fetched at chat initialization (basically, at web
client initialization), if hr is installed.

Second, when focusing on the composer of a channel, the members of this channel
are fetched. In the case of a chatter, the members are already known as they
are the followers of the document.

When the user types a mention, we first display suggestions from the pre-fetched
partners, and we only perform an RPC when there are no more result matching the
search string. This RPC searches among user, and then partners if there aren't
enough matches.

A few side changes occurred:
  - auto_join set to True on user_ids field of res.partner to boost the query
    that searches partners that are users
  - the '/mail/read_followers' route now returns follower's email as well, as
    we need it for the mention;
  - a partner can now be mentionned several times in the same message;
  - mentionned partner previsualization has been removed, mainly because of
    the previous point, but also because it simplifies the code;
2015-11-27 11:47:34 +01:00
Christophe Simonis 0a07be8190 [MERGE] forward port of branch 9.0 up to 87a8896 2015-11-03 13:14:23 +01:00
Thibault Delavallée 6dfcc5f9c8 [FIX] various: get_access_action form one to multi
As this method is overided in several modules, the mix of new and
old API makes it difficult to handle. Indeed in some cases we
receive the expected dictionary, sometimes in a list, sometimes
in a list of list, due to api.one decorator.

This is a change in the method API, however it is currently completely
buggy. Moreover this method is used internally and should not be
used as an external API. Lastly, this method is new from v9.
2015-10-30 15:44:15 +01:00
Olivier Dony 8bdd15b5b6 [MERGE] Forward-port 9.0 up to ff9b997736 2015-10-11 20:55:43 +02:00
Martin Trigaux e256262b0e [MERGE] Forward-port 9.0 up to 422f3b5d 2015-10-07 16:42:33 +02:00
Jérome Maes 3e3ba3e2b7 [FIX] mail : controller chat_post force text to be plaintext
This controller is mainly used by im_livechat which don't send html message. It is more secure to force it in plain text. If anonoymous user write html tags, it will be escaped and sanitize.
2015-10-07 16:37:23 +02:00
Jérome Maes 2a676ee11c [FIX] mail : broadcast needaction for concerned partners in particular bus channel
Use the (dbname, 'ir.needaction', partner_id) channel to broadcast needaction to partner. Some message can be needaction, without belonging to a mail channel of the partner. Keep the (dbname, 'res.partner', partner_id) channel for conversation header.
2015-10-06 09:44:51 +02:00
Jérome Maes 22631a152a [FIX] mail, website_mail : special controller for message author avatar
Previous commit (3304b31938) was not performant enough for AL, so got special autorization to make a particular controller for mail.message author avatar. Avatar of message is avaiblable if current user has 'read' access right to the document. Otherwise the default avatar is one white pixel.
2015-10-06 09:43:46 +02:00
Martin Trigaux b776d66d85 [FIX] all: ressource -> resource
Courtesy of Kris Krnacs
2015-10-01 10:54:04 +02:00
Thibault Delavallée 396c5db41a [FIX] mail, various: buttons in notifications
Various fixes :
- new button (task / issue / note) param name + correct action
- method button fix
2015-09-22 10:28:01 +02:00
Jérome Maes 762cc2dbfa [FIX] mail : make follower subtype edition works
On follower list of a document, the user can (if access rights granted) edit the subtype subscription of other follower. This open a modal with checkboxes. This is commit make this feature works and adapt it to channel follower.
2015-09-14 10:16:21 +02:00
Géry Debongnie 09b4893e12 [FIX] mail: prevent wrong sql query in some cases
Sometimes, the variable partner_id is False (on first connections).  This leads to a
crash because partner_id is a boolean instead of an integer. This commits simply
sidestep the problem.
2015-09-01 21:04:32 +02:00
Jérome Maes 449f254638 [REF] mail : include real time, and replace Timeline features
This commit add instant messaging features in mail module to make it a real team collaboration tool. Lots of these new features will replace Timeleine view (which is not removed in this commit). Many files have been moved, split or created for a better structure.

- My Channels : A user can be member of channel (mail.channel). These are discussion group, but also an aggregate of notification. Setting a channel as document follower, it will receive all the message (of the chatter) in real time, as information stream.

- A new Inbox : this aims to replace the timeline view. The user will see its channels grouped by 'slot', and receive the message in real time. Jump to the form view, invite people, create private discussion group, talk directly to another employee, ... are the main features. Your message can still be starred. The 'Inbox' will only contain your needaction.

- Needaction concept : a needaction is a message calling you to do something. If you follow a document as a person, the posted message will be 'needaction' for you. It can also be a message where you are mention with a '@my_name' (this feature is not added in this commit).

- The chatter doesn't change so much. It still allow you to see the discussion about the document, to star some message, and treat your needaction.

- Chat : the only way to have a minified conversation is from the Inbox Client Action. It allow you to keep an eye on a channel when working on document.

- Compose Message : it is now common to the Inbox, and the chatter. It offers shortcode substitution, attachments management, and optional subtype.

- UI : the chat window has been clean, they have a new look now.

To do so,
- Chatter code have been completely rewrite, independently of timeline view
- Add 'bus' as mail dependency, to insure real time
- A mail.message is broadcasted on the bus channel (db, mail.channel, channel_id), and a channel header on (db, res.partner, partner_id)
- Extracting mail_thread mixin used for Chatter and ChatMailThread (Inbox client action). This uniformize the programming structure with the server side
- Clean CSS style and use LESS instead of CSS
- Define a new messafe format (message_format method in mail_message.py), compatible with fetching and broadcasting
- Apply guideline coding conventions

This commit also break the module im_livechat, since im_chat models don't exists anymore and will be fixed in the next commit.

Thanks to Thibault Delavallee (tde) for the long debates and precious advices, Richard Mathot (rim) for the support, Simon Lejeune (sle) for the client action layout, and the Usability Team (apr, lle, bst yti) for the long testing.

Conflicts:
	addons/mail/models/mail_thread.py
2015-09-01 20:16:09 +02:00
Jérome Maes 4af9631072 [MOV] mail, im_chat : move files and code from im_chat to mail and bus
- im_chat.session will be replaced by mail.channel
- im_chat.shortode is renamed into mail.shortcode
- im_chat.presence is moved to bus module
- js and controller code is moved from im_chat to mail module

This commit only move files, and modify manifests, bundles, ... The code will be adapt in the next commits.
2015-09-01 20:16:08 +02:00
Thibault Delavallée 01ab75f597 [IMP] mail: notification emails with button
Notification emails have been redesigned. They notably include buttons
allowing to perform some action directly from the email.

The notification creation and sending has been partially rewritten
and improved. The purpose is to lessen the number of rendering to perform
when sending emails to recipients. Recipients are first categorized into
groups. Basic groups are partners and users. The notification template
is then rendered twice, one for followers and one for not-followers. In most
cases there will be few rendering to perform. Through inheritance it
is possible to further categorize users. For example HR users / officers
that have approve / refuse buttons in their email.

A custom data structure is used to store data about buttons and actions.
URLs, follow / unfollow are added in the structure and used in the
template to render the email for a given group.

New routes are added in mail. Those allow to perform some action, like
going to a form in create mode, following / unfollowing, executing a method,
sending a signal for a workflow. Those routes are for users only and rely
on classic access rights.

A generic route for viewing records is added. It replaces the old redirect
action. According to some specific action given by the already-existing
get_access_action, the record will be visible for everybody (forum, blog)
or restricted (going on the Inbox / login / form view, according to access
rights).

The next commit will add the various inherits necessary to add the actions
in the main addons.
2015-08-28 17:30:42 +02:00
Thibault Delavallée cbb21421a3 [CLEAN] mail, hr_recruitment: unused imports 2015-08-25 17:17:30 +02:00
Christophe Matthieu 6baf611df1 [IMP] web: create generic controller '/web/content' and '/web/image'
Replace deprecate controllers like /web/binary/image, /web/binary/saveas...
Use ETag for all content with 'unique' option to cache the content if the content is never changed.
2015-08-21 22:06:52 +02:00
Thibault Delavallée e6f038a821 [REF] mail: mail_thread: followers update
Followers can now be partners or channels. Partners following a document
will receive needaction, as previously. However people can follow documents
through channels. Members of a channel are able to listen to a stream
of messages using the channel. Those messages do not create needaction
messages. It is therefore possible to follow documents without receiving
too much notifications. For interesting documents subscribing with its
partner will create notification.

message_follower_ids fields is udpated. It is now a many2many to
mail.followers, not to res.partner anymore. A subscription can be either
a partner (partner_id) or a channel (channel_id).

Some access rules have been updated accordingly.
2015-08-21 12:11:56 +02:00
Thibault Delavallée 9bd8c00b01 [IMP] mail: moved methods called by mail_followers.js to controllers,
updated their code accordingly.

Subtype display in the follower widget has been improved: now displaying correctly
subtypes ordered by related model, then internal / not internal, then sequence.
2015-07-02 13:33:59 +02:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Olivier Dony c3e812f34a [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 10025 rev-id odo@openerp.com-20140430102552-qkwv20b20nve64th
bzr revid: odo@openerp.com-20140430110048-6971xplq8k073tto
2014-04-30 13:00:48 +02:00
Jamin Shah (OpenERP) d9423585d5 [FIX]Fixed the issue of mimetype not detected properly, used python mimetypes module to detect file's mimitype.
bzr revid: jas@tinyerp.com-20140414052904-rp4oia2py6b61xg8
2014-04-14 10:59:04 +05:30
Thibault Delavallée 33d349f33b [FIX] mail: fixed download_attachment controller
bzr revid: tde@openerp.com-20140124160457-hofozo85ebzbogu7
2014-01-24 17:04:57 +01:00
Antony Lesuisse 3d8b7984be import cleanups part1
bzr revid: al@openerp.com-20131022170659-kg9err029ha22evh
2013-10-22 19:06:59 +02:00
Christophe Simonis f3ac2643d9 [FIX] mail: /mail/download_attachment: content_disposition() does not take request as parameter anymore.
bzr revid: chs@openerp.com-20131015154357-4fnj8b6fy5sbvpa7
2013-10-15 17:43:57 +02:00
Christophe Simonis b2c74f5f42 [FIX] mail: use @route decorator for routes
bzr revid: chs@openerp.com-20131015153631-18pdi1xzk84kg1y2
2013-10-15 17:36:31 +02:00
Thibault Delavallée ed62d1dac7 [REF] mass_mailing: first refactor
Mail statistics are now stored onto a separated object (mail.mail.statistics), allowing to
handle emails separately from statistics (among other removing mail.mail entries while keeping
statistics).

Everything linnked to opened/replied/bounce is not managed by mass_mailing, removed added code
in mail module.

bzr revid: tde@openerp.com-20130913115408-322cyjipdg680as6
2013-09-13 13:54:08 +02:00
Thibault Delavallée 38a534dee0 [IMP] mail: first implementation of tracking and bounce management.
Added 2 fields on mail_mail to count read/bounce.
Added bounce alias bounce-mail_id-model-res_id.
Added message_receive_bounce method that try to incremetn message_bounce field.

bzr revid: tde@openerp.com-20130806151143-7dw6xlj8n7mh0nqe
2013-08-06 17:11:43 +02:00
Vo Minh Thu 960252d091 [IMP] mail: added JSON end-point to receive mails.
bzr revid: vmt@openerp.com-20130619132123-efw3fyqqw33q0s4q
2013-06-19 15:21:23 +02:00
Christophe Matthieu 6c73d8dff8 [IMP] web: move controler download_attachment into mail.
bzr revid: chm@openerp.com-20121211145343-jhjj9sohn2shkbt9
2012-12-11 15:53:43 +01:00