Commit Graph
31 Commits
Author SHA1 Message Date
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
Cedric Snauwaert 5fd3a0446b [FIX] mail: remove classes from short_body and body likewise 2015-12-09 15:24:34 +01:00
Géry Debongnie 919179b417 [FIX] mail: opening a chatter mark all messages as read
also, send correct notifications in case several channels are concerned.
2015-11-23 16:29:08 +01:00
Thibault Delavallée 007e217c54 [FIX] website_forum: new mail api
set_message_read has been removed from the mail api. It is replaced by
set_message_done. Thanks Lorenzo Battistini.
2015-11-23 11:01:57 +01:00
Thibault Delavallée 104826c311 [FIX] mail: subtypes read as sudo
Indeed portal and public users may have to read internal subtypes to perform some
check in the code.  However the rules do not allow them to read those internal
subtypes. We have to read some subtypes as sudo then.
2015-11-20 11:25:17 +01:00
Thibault Delavallée 2e583eb7c9 [FIX] mail: chatter: re-re-add the read more / less
The read more / read less in chatter has been removed in the new timeline and
then cleaned timeline introduced at cc6d2aa995.
This feature has been brought back at revision 486aab5098.
However a new cleaning removed the feature at revision 2a5f07e0b9.

This commit brings back this feature for the second time. Next one brings free
cookies.
2015-11-18 13:48:27 +01:00
Thibault Delavallée e01e24aa9c [FIX] mail: chatter: subtype when tracking
When having a tracking, the subtype description should be displayed. This is
used for tracking linked to a subtype like Task Opened, Task Blocked, ...

This feature was forgotten when refactoring the chatter for v9 and is now
back.
2015-11-18 13:48:27 +01:00
Thibault Delavallée 69ed801979 [FIX] mail: internal note recipients
In some cases internal notes could be sent to more people than expected.
The correct list of recipients was computed but not assigned. Doo.
2015-11-17 10:49:20 +01:00
Aaron Bohy eae08d39d6 [FIX] mail: mark as read: notify correct partner
When calling 'set_message_done' on a message which is a needaction for several
partners, the method was executed as root. This was an issue for the triggered
notification, as it was thus always sent to the admin.

For example, when Demo user marked such a message as read, he never received
the notification, but the Admin did, and its notification counter weirdly
decreased, while the one of Demo user remained the same.
2015-11-17 10:06:18 +01:00
Aaron Bohy 5264ccf0d0 [IMP] mail: needactions and messages read
Mainly concern the client action:
	- Display needactions per channels
	- For all channels except Inbox, clear needactions when opening the channel
	- Add snackbar to undo needactions clearing
	- Display a separator between read and unread messages in threads
	- Fix active channel (for Inbox and Starred) display in sidebar

Various minor changes in chat_manager:
	- Code refactoring of bus notification handler
	- get_channel() don't fallback anymore on first channel
2015-11-12 08:51:56 +01:00
Géry Debongnie 622bd038e4 [FIX] mail: various ui improvements
- display star/mark as read icon next to the message title instead on
  the far right
- display unstar all message in channel starred
- enable/disable the 'unstar all' and 'mark read' buttons depending on
  the number of messages in the corresponding channels
- display star on the left sidebar in 'squashed messages'
- tweaks to padding in client action
- display hash in channel name in lighter tone
- light opacity in sidebar
- star icon in message sidebar is clickable + small less refactoring
- message sidebar is aligned with the message now
- messages are not squashed in inbox/starred
2015-11-09 16:36:52 +01:00
Géry Debongnie ff84737054 [IMP] mail: add mark all read feature to inbox 2015-11-04 16:31:44 +01:00
Aaron Bohy de665f4b6d [FIX] mail: mail_message: needaction_partner_ids wording
The 'string' attribute for both needaction_partner_ids and needaction fields
was 'Need Action'. This was problematic for example in the custom filters of the
searchview as it looked like the same field was appearing twice.

Update mail.pot as well.
2015-11-04 16:31:44 +01:00
Géry Debongnie 9f86de81bc [FIX] mail: fix permission issue when starring/marking messages
If a user does not have write permissions on a model, he should still be
able to remove himself from the many2many relation.

This caused a problem: some messages could not be modified by a user
(star/unstar or mark as read)
2015-10-16 15:52:01 +02:00
Thibault Delavallée eb7139b01f [IMP] mail: context key for message author subscription
By default the author of a message is always removed from the notified recipients.
However in some cases it is interesting to be able to notify the author. A context
key has been added that handle that case.
2015-10-05 11:56:05 +02:00
Thibault Delavallée 86e50baefc [REF] mail: small method refactoring to ease chat integration 2015-10-01 16:36:24 +02:00
Thibault Delavallée 486aab5098 [FIX][BACK FROM TRASH] mail: chatter: read more / read less
Read more / less feature is back (and probably ugly). It has probably been
removed when refactoring the old chatter.

[FIX] tools: html shortening: encoding issue
2015-09-24 16:20:53 +02:00
Thibault Delavallée 5492f88126 [FIX] mail: mail_message write right
Notified people should be able to write on the message, for example to be
able to star / unstar, needactionize / unneedactionize (nice word).
2015-09-21 12:44:40 +02:00
Jérome Maes 223143bd97 [FIX] mail_channel, mail : various
mail_channel: call create with mail_create_nosubscribe=True to not subrscribe creator as follower,
since channel is not a mail thread (channel followers make no sense)

mail : adaptation with new chm controller for attachment, and remove author_ avatar from message format
2015-09-01 21:04:31 +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
Thibault Delavallée e755791af8 [FIX] mail: various fixes
- mail_message: fixed internal subtypes

Indeed has_group works only for uid and does not care for any given recordset.
Probably we need a is_in_group method on res.users. Someone smart could code it.

- mail_message: update message before notify

This way in the various notify methods, the message is correclty updated with
needaction and recipients. Also cleaned some comments.

- mail_message: avoid email loops

Do not notify people having the same email as the message / email to propagate.

- mail_message: fix access right issues

When computing recipients and partners to email, use a sudo for some internal
computation to avoid access rights issues. Indeed public user may go through
this method (forum for example).
2015-08-27 17:07:02 +02:00
Christophe Matthieu d4bae06d08 [IMP] web: use css to display attachment mimetype
Widgets and website display images or display the type with icon like pdf, doc...
2015-08-21 22:06:52 +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 88b8cd0587 [REF] mail: model update for NewChatter
Main changes :
- mail.notification model is removed. People do not receive notifications
anymore. Instead two ways of following documents exist
  - using a channel; messages will be displayed on the channel itself
  in a near future commit
  - following with its partner; messages will all be considered as
  needaction, using a new m2m table. People should receive less
  needaction messages by following less records by themselves.
There is no more read / unread state anymore. Instead only needaction
messages are considered. Todo (Favorites) messages still exist, and are
stores on a new m2m table instead of using decorated notifciations.
- the main filter for documents is not message_unread anymore, but
message_needaction. A lot of views and filters have been updated
accordingly.
- the vote feature has been removed
2015-08-21 12:11:56 +02:00
Thibault Delavallée 9f844c570f [REM] mail, calendar: removed dead code (unused method and its
override, unused variables; duplicated code; commented code)
2015-08-06 10:06:18 +02:00
Raphael Collet b1915f506d [FIX] mail: fix method _get_default_author to return a recordset instead of an id 2015-07-11 03:00:40 +02:00
Thibault Delavallée 10f81cce31 [MOVE] mail: mail_message and mail_mail fields reorganization.
The fields were a bit messy. They have been reorganized so that field declarations
are grouped into content / from / to / gateway.

Nothing changed, only organization and some tooltips.
2015-07-09 11:13:11 +02:00
Thibault Delavallée 9cd9aaaa17 [IMP] mail: new internal-only subtype feature.
Starting from now, subtypes can be internal. This means that only employees
(group_user members) can see the messages with this subtype. This feature
replaces and enhances the 'log a note = no subtype = internal only'
feature.

Public and portal users cannot see internal messages. This allows to have
subtypes and a follow mechanism that works for employees and is not
visible for external people.

Its first use will be for Crm Activities, allowing to have custom
subtypes visible only for salesman and not send to the customer.
2015-07-01 12:52:52 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
Valerie Pirenne c24332e6da [IMP][ADD] mail, various: timeline view.
This commit introduces a new view type, the timeline view. This view is
intended to display messages like the previous chatter. This is now a view
like the form or list view. Like other views it will be possible to have
custom templates for some specific needs, allowing customization.

[IMP] mail: the value tracking is modified. Previously messages were created
containing the modified values. Those values are now stored, using a new
model mail.tracking.value. The message body is dynamically build based on
the values. Tests have been updated.

This version is temporary. Indeed two main modifications will come in a short
future :

 - the new design will improve the display
 - the slack mode will change the way the Inbox and notifications are managed

All glory to the Hypnotoad.

Special thanks to Valerie Pirenne (vpi), Jerome Maes (jem) and Richat Mathot
(rim) that did not code but said a lot of things. Martin Trigaux (mat) did
nothing, a bit like for the slides modules, but he is busy sending emails.
2015-05-21 12:10:25 +02:00
Thibault Delavallée 4a975f1b7d [MOV] mail: moved files according to the new module organization 2015-04-27 12:52:45 +02:00