summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/models
AgeCommit message (Collapse)Author
2019-04-17[FIX] mail: Don't display message if only subtypeLucas Lefèvre
Currently, if a message does not have any tracking value, any attachment and no body BUT has a subtype with a description, the message is not considered as empty. The message subtype should not influence its "emptyness".
2019-04-15[IMP] mail: improve document chat windowPrakash Prajapati
1. In the systray messaging menu, when hovering on a notification linked to a document chat, it now shows an "expand" icon. Clicking on icon opens the corresponding form view with the chatter. 2. Messages in a document chat window no longer show linked document in their header, as this is redundant with title of chat window. 3. Font size of words "on" and "from" in header of message in chat windows have been reduced in order to closely match font size of document link. Task-ID 1929169 closes odoo/odoo#30957 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-03-06[REF] mail: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-22[MERGE] forward port branch saas-12.1 up to 0f4abc5c228Christophe Simonis
2019-02-13[IMP] mail: allow tracking on groups protected fieldsLucas Lefèvre
Purpose ======= Currently fields with a `groups` attribute can't be tracked. Otherwise changes would be visible by all in the chatter, including users which normally don't have the access rights because they are not members of `groups`. Specification ============= Filter tracking field values according to the `groups` attributes. Users without the access rights should not see them. If a message is only composed of tracking values and the user doesn't have the rights to see them, an empty message should not be displayed.
2019-02-14[FIX] mail: enable seen feature only on direct chatsAlexandre Kühn
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a There were performance issue with the seen feature in multi- user channnels, therefore it has been disabled for them. As a result, only direct chats have this feature.
2019-02-12[FIX] mail: throttle batched `channel_fetched` RPCsAlexandre Kühn
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a The commit above added the seen icon on messages in a channel. However, since this feature, there was a performance issue when opening the systray messaging menu with several pinned channels: lots of RPCs are made, almost 1 for each preview in the messaging menu. The RPCs comes from the reception of the last message in the channel, to let the current user notify that he has received the messages in the channel. Those RPCs were made for each channel, thus the more pinned channels the more RPCs were made when opening the messaging menu. This commit fixes the issue by throttling and batching the RPCs. To do so, instead of letting the channel model handle the RPC `channel_fetched`, the mail service now handles it. This has the advantage to throttle the RPC globally and to batch the requests to notify that messages have been received on channels. closes odoo/odoo#31026
2019-02-07[IMP] mail, hr_holidays: use leaves to compute im_statusXavierDo
When on leave, the im_status can be either leave_online or leave_offline. This will allow to display a specific icon and a default message when the user is not at the office. The leave can have an out of office message. This message will be displayed in the chat window instead of the user ooo message, and the end date of the leave will be displayed too. Technical details. Right now the im_status access leaves directly to know if a user is on leave or not. An index has been added to optimise this request (thanks to rco). A solution to optimise this would be to compute part of the information in a cron. Task: 1856205
2019-02-07[IMP] mail: add ooo status in chats windows.XavierDo
In a chat window with a single usert (dm_chat) the ooo status of the other user is displayed on the top when set. Task: 1856205
2019-02-07[IMP] bus, mail, mail_bot: add im_status serviceXavierDo
This commit is a refactoring of im_status management. This commit also add im_status in two places, near the author in a mail thread and on each suggestion when using mentions. A service to manage im_status will have multiple benefits here: -centralise information, avoid to call the server multiple time for the same im_status -update all im_status at once and keep consistency in display. With this commit, the im_status updates are now done by rpc call. Updates where previously made with the bus but this has some drawback, since the bus will only give the information 50 seconds after the beginning of the request, in the worst case, we van wait 2*50 seconds to get an update. More than that, the im_status where only updates for pinned dm_chat. Dm chat are synchronized cross tabs, making the use of the bus possible for this purpose. Since we will need to display im_status not linked to dm_chat, the list to update will be different from tab to tab making the use of bus difficult for this purpose. Technical notes: -im_search has been moved from bus to mail addons since it concerns mail.channel -Update of an im_status should be reflected everywhere in the page. Since im_status is a rendered template used in multiple widget, we should add the correct logic to all concerened widget. The current solution is simple: use a jquery selector to find every place where im_status is rendered. -we add a new im_status: im_partner. This will indicate that that the partner has no user linked to him, making it possible to avoid to ask for status updates for this partner. -The update will only be done when the tab is focused. (and will be done asap once the tab get focus back)
2019-01-14[MERGE] forward port branch 12.0 up to 6a0675d36ddChristophe Simonis
2019-01-11[FIX] mail: Failed mail notification wrong titleJorge Pinna Puissant
opw-1921686 The failed mail notification group all the records of the same model that failed to send an email. Before this commit, the failed mail notification displayed as title the name of the last record that failed to send an email. Now, the notification displays as title the model name. closes odoo/odoo#30134
2019-01-09[FIX] mail, sale: indentation & spacing in docstringsXavier Morel
rST is somewhat unforgiving when it comes to whitespace. The extra indentation on list would generate (nested) blockquotes instead of just paragraphs & list items, and the missing empty lines would make rST parse the entire block as a single paragraph rather than a paragraph followed by a list. closes odoo/odoo#30058
2018-12-21[IMP] mail: adds delete and upload to chatterThanh Dodeur
This commit adds the ability to upload and delete attachments from the chatter. Task: #1911277 closes odoo/odoo#29702
2018-12-06[IMP] mail: channel seen icon indication ('v' and 'vv')Alexandre Kühn
This commit adds the seen icon next to a message for all channels except livechat. It tracks received and seen messages for all members of the channel. Icon is either 1 or 2 check(s) ('v' or 'vv'). Those are the different states of this 'seen' icon: ICON: DESCRIPTION: no check .................. no one has received the message. 1 check ................... some members have received the message, no one has seen it. 2 checks (greyed-out) ..... some members have seen the message, some or everyone has received it 2 checks (green) .......... all members have seen the message This icon is not shown for messages preceding the last message seen by everyone, in order to reduce visual noise. Task-ID 1881001
2018-12-06[REF] im_livechat, mail, website_livechat: clean mail model folderAlexandre Kühn
The utility classes `Timer`, `Timers` and `CCThrottleFunction` were only used by the feature 'is typing...', thus all those files were in the same folder. This commit moves the utility classes in a dedicated folder, and introduces a folder for thread mixins, in preparation for future features on threads that will be implemented as mixins.
2018-12-06[IMP] mail: rename DM conversationAlexandre Kühn
This commit adds the possibility to customize the name of a DM conversation. To do so, click on the gear icon when hovering on a DM in the discuss sidebar. This feature intentionally removes the access to the settings of a DM, because the settings view only makes sense for non-DM conversations. Task-ID 1881001
2018-12-06[IMP] mail: merge private and public channels in discussAlexandre Kühn
Discuss sidebar now has a single category for public and private channels called "Channels". Private channels are prefixed with a keylock icon. Task-ID 1881001
2018-12-06[IMP] im_livechat, mail: improved "is typing" notificationAlexandre Kühn
With this commit, the UI for "is typing..." notifications has changed. ** before **: In Discuss & chat windows, "is typing..." notification bar at the bottom of the thread, inside the conversation. ** after ** In chat windows, animated '...' next to conversation name. In Discuss, animated '...' next to conversation name in sidebar, and text below the composer. Task-ID 1881001
2018-12-06[FIX] mail: get members on channel_infoAlexandre Kühn
Before this commit, when accessing a channel after a page reload, the list of members in a channel was not known until the composer on this channel has the focus, either in the Discuss app or in a chat window. This was a good-enough condition when information about members was limited to mention suggestions, which requires having the focus on the composer. However, with the 'is typing' features on channels, it requires being aware of the members of the channel at the moment of the rendering in discuss or in a chat window. This commit fixes the issue by providing the list of channel members when retrieving information about the channel. Without this fix, the 'is typing' notifications could sometimes not determine the name(s) and email(s) of user(s) typing something.
2018-12-05[IMP] im_livechat : uses anonymous name only if visitor is anonymousDavid Beguin
Before, if the visitor was logged in, anonymous name = user.name. But if we use anonymous name field even if visitor is not anonymous, we cannot know, in stat e.g., if the session was really made with an anonymous visitor or not as the field is always filled in. Now, if the visitor is not anonymous, we use directly the user.name but we do not fill in the anonymous name. So that if anonymous name is null, we know afterwards that the session was made we a real anonymous visitor. Since the anonymous name is empty if visitor is logged in, we cannot use anonymous_name anymore to get the title of the session window. Task ID : 1895998 Closes PR #28283
2019-01-28[MERGE] forward port branch saas-12.1 up to d3b8422c9c4Christophe Simonis
closes odoo/odoo#30614
2019-01-24[IMP] mail, snailmail, snailmail_account: improve error managementAntoine Prieels (ANP)
When a letter is sent through snailmail and encounter an error, it used to create an activity to the user to notify him that there was an error with its letter. When a user had this activity, he didn't have any clues of what was the error and how to manage it. So we decided to better handle snailmail errors and give the possibility to the user to easily fix the source of the snailmail errors. First to give a better feedback on the letters in errors, we've made features similar to ones existing for emails: - We add a mail message on the document that sent the letter, and put a small paper plane icon, which is red when an error occurs (like the envelope for email) - As letters can be sent in batch, we've also added an entry in the systray to easily manage the different documents having snailmail errors like for emails. Then we identified, the most common errors encountered with the snailmail letters and give proper way to let the user fix them: - Missing Required Field: - The address is not complete, some of the fields are empty. - We open a wizard allowing the user to modify the partner address and we try to resend all letters having this error on the modified partner. - We also try to avoid this error, by opening the wizard before sending the letter, but it only works for single documents, not for batch. - Trial/Credit Error: - The user has not enough credits to send letters anymore. - We open a wizard that give a redirection lnk to add credits on its iap account. - No Price Available: - The destination country is not supported by any of our providers, and we cannot do anything to send this letter. - Format Error: - The format of the pdf report send by the user is refused by our providers, because some visual stuffs are not respected, for example blank zone to print barcode or margins. - We show a wizard to the user letting him check a setting option that add a cover page in the envelope and the documents will be send with this extra page containing the address. - Unknown Error: - This is not one of the listed error above. - A wizard suggesting the user to contact support is displayed. The cron that try to resend letters on error, has been addapted to only try to send the error of type Trial/No Credit, because the account might have been reloaded, and other errors, won't change if they have not been fixed locally. closes odoo/odoo#29685
2019-01-21[IMP] mail: chatter channel notificationDemaret Rivarola Johan
Ability to notify the channel but do not add the channel as a follower. Faster than mentioning every member of the channel. Also, clean the rendering of the mention suggestions name to avoid having escaped char in the UI. Task id : 1859802 Closes #25887
2019-01-09[MERGE] forward port branch saas-12.1 up to 8aa8548d8abChristophe Simonis
2019-01-02[IMP] mail: group mailFailures by type in systrayAntoine Prieels (ANP)
We want to add new kinds of failures to the list in the systray, such as Snailmail or SMS failures. Until now, failures linked to documents of the same model were grouped together in the systray. Different types of failures should not be grouped in a single line so we add a '_failureType' variable to mailFailures and group them only if their type is the same. closes odoo/odoo#29855
2018-11-26[FIX] mail: reply message from inboxAlexandre Kühn
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c Before the commit above, it was possible to reply to a message from Inbox. Those messages were linked to a document, and replying to any of them put a response in the related document. This feature has been broken since the commit above: the reply icon was only shown on messages linked to a channel, instead of message linked to a document. Also, it was erroneously prompting that the message was sent to the channel, even though it was not the case. This commit fixes the issue by toggling the visibility of the reply icon, so that it is shown only for messages that come from a document. Also, since posting a message requires a thread, this commit added the possibility to post a message from a mailbox, which instead posts the message to the related document thread. Task-ID 1912647 closes odoo/odoo#29028
2018-11-26[FIX] mail: messaging menu show undated DM previews lastAlexandre Kühn
This commit fixes two related issues: 1. Previews without any message should not be dated. Before this commit, when a channel or dm preview had no date, it was displaying the current date. This commit fixes the issue by not showing the date for those previews. 2. Dates previews should appear before undated previews. Before this commit, undated previews were considered similarly as dated previews in the ordering of previews in the messaging menu. Since DMs are shown before Channels, any pinned DM without any message were displayed on top of messages with some message. This commit fixes the issue by putting undated previews after dated ones. This rule is applied before considering type of the thread (i.e. DMs before channels). Task-ID 1912001
2018-11-26[FIX] mail: no '#' prefix in DM nameAlexandre Kühn
Before this commit, DMs had the prefix '#' in their displayed name (e.g. '#Demo User'). This commit fixes the issue by putting this prefix only on non-chat DMs. In particular, mailboxes, DMs and Livechats no longer show this prefix. This change is also visible in the breadcrumb of the discuss app. Task-ID 1911738
2018-11-20[FIX] mail: notify when resetting unread counter of threadAlexandre Kühn
Before this commit, we had the following issue: 1. Open two tabs A & B. 2. Receive a message from a channel in tab A. 3. Mark it as read in tab A by clicking on the chat window of the channel. > The unread counter is correct in tab A: no unread messages on this channel, and the messaging menu counter has been updated. > The unread counter is not correct in tab B: it still has unread messages on this channel, and the messaging menu counter has not been updated. The issue was caused by not notifying the updated unread counter to the widgets when receiving the 'channel_seen' notification from the longpoll. It was working in tab A because this is were we made the action, so that it already marked messages as read without waiting for the longpoll response. However, Tab B has to wait for the longpoll response to update the unread counter. It was updating the counter, but it was not notifying the widgets. This commit fixes the issue by letting the widgets know when the unread counter has been reset. Task-ID 1911239 closes odoo/odoo#28833
2018-11-16[FIX] mail: no crash when searching messagesAlexandre Kühn
Revision on https://github.com/odoo/odoo/commit/299ebb2cdf63de2e3967da0d2f3e7effd239812b The commit above added the notion of moderation, which requires re-rendering the thread when a message has its moderation changed (i.e. the message is deleted on reject or is no longer marked as 'pending moderation'). However, this condition was triggered even when the moderation status on the message has not changed. This introduced a crash when using the search in discuss: - Access a channel with more than 30 messages, so that not all messages have been fetched. - Search messages in this thread so that it displays more than 30 messages, and the last message of those has already been fetched. > It crashes with "Cannot read property 'getID' of undefined". The bug comes from re-fetching messages: it behaves as a "load more" fetch, although no message has been stored yet. A "load more" fetch requires at least one message in order to determine the minimum message ID to fetch, thus the crash due to having no message to get such an ID. Here's the explanation why it fetches with load more: when performing the search and fetching the same last message, it will detect that it has already been fetched. Its moderation status is 'accepted', and it will assume a change of moderation status. This will trigger a fetch and render of the thread. At this moment, if the search exceeds the fetch limit, not all messages will be fetched, so that this fetch is considered as a "load more" fetch. This commit fixes the issue by only re-rendering the thread when there is a change of the moderation status on an already fetched message. Since changes of the moderation status are handled by means of the longpolling, it should be rare to run into the case of having a change of moderation status on a message while using the search on a thread. Task-ID 1910180
2018-11-16[FIX] mail: easily mention followers and employees in chatterAlexandre Kühn
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c Resulting of the mail JS refactoring, the list of prefetched suggestions has been changed as follow: - before: list of list of mention suggestions `{Array<Object[]>}` - after: list of mention suggestions `{Object[]}` The change resulted in wrongly thinking that wrapping the list of suggestions in a list was pointless, thus simplifying it as a simple list of mention suggestions. However, because of this change, it has become much harder to mention employees and followers of documents from the chatter: it now always fetches all partner suggestions at all time, whereas before it was suggesting followers, then employees, and finally all partners based on the input of the user. In fact, there was a purpose of using a list of list of prefetched mention suggestions, which is to group suggestions by "priority": followers first, then employees, and all partners as a last resort. This commit re-introduces prefetched mention suggestions as a list of list of partners, so that it re-becomes easier to mention followers and partners of a document from the chatter. Task-ID 1910111
2018-11-14[FIX] mail: no crash on grouped inbox messages previewsAlexandre Kühn
Revision on https://github.com/odoo/odoo/commit/5f8d3c61bee40d027efc5041cdc4bca5e67c42d7 Before this commit, there was a traceback when you had two needaction notifications related to the same document. This is caused by a typo in the commit above: the object `similarItem` has a property `messageIDs`, but the code wrongly access the property `messagesIDs` (see the extra "s"). Steps to reproduce: - Set notification management to 'Handle with Odoo' for Admin - Demo mention Admin twice on a specific project task - Admin opens messaging menu Display error `Cannot read property 'concat' of undefined` Issue reported on this PR comment: https://github.com/odoo/odoo/pull/28462#pullrequestreview-175001349 Task-ID 1909521 closes odoo/odoo#28703
2018-11-07[FIX] mail: mark as read per previewAlexandre Kühn
Before this commit, when there was several previews on the messaging menu that were not linked to any document, marking one of them as read had the unintended behaviour to mark all of them as read. Steps to reproduce: - Admin with notification management as 'Handle with Odoo' - Demo assign Admin to two different tasks - Admin mark one preview as read > Both previews notifying assignment to a task have been marked as read This is caused by the fact that messages of those previews are not related to any document. As a result, when marking one preview as read, it maps related messages to mark as read, which was taking into account all messages that are not related to any document. With this commit, previews now tracks message IDs, so that marking one preview as read only mark the related messages as read. Task-ID 1907159
2018-10-16[FIX] mail: simplify channel domain for message_fetchAlexandre Kühn
It was simplified by https://github.com/odoo/odoo/commit/84af9382e2315964209bb065945b5d9116ddb11a but the forward-port somehow failed.
2018-10-16[FIX] mail: improved message_fetch for moderated channelsAlexandre Kühn
There was two issues with the previous code: 1. It was using a weak heuristic to determine whether the current thread is a channel (ID is a number) 2. For any channel, it was always passing `moderated_channel_ids` with some values to the server, even though the channel is not moderated at all. This commit solves both issues by passing `moderated_channel_ids` only for moderated channel. Also, this logic has been moved from SearchableThread to Channel, since moderation makes only sense for channels and channels are aware of whether they are moderated or not.
2018-10-16[FIX] mail: no moderation in chat windowAlexandre Kühn
Before this commit, a moderator of a moderated channel could see commands on 'pending moderation' messages in a chat window, although none of them work in chat windows. Those commands only work in Discuss. Making them work in chat windows is not trivial, because some code must be redesigned for this. This commit disables moderation commands in chat window. Moderators of such channel now see 'Pending moderation' on such messages in chat window, and mouse-hovering on this annotation tells the user to moderate those messages in the Discuss app. Task-ID 1887963
2018-10-01[MERGE] forward port branch saas-11.4 up to 57e387b6452Christophe Simonis
2018-09-20[FIX] mail: mark document thread preview as readAlexandre Kühn
Before this commit, it was not possible to mark a document thread preview as read from the messaging menu. This issue comes from the fact that document message previews are built from messages in the Inbox. The computation of the unread counter is correct for the preview, but not for the associated document thread object which has a counter of 0. Since it is only possible to mark as read when the counter is strictly greater than 0, the 'mark as read' did not have any impact. This commit fixes this issue by ensuring that the unread counter of a document thread matches the number of needaction messages it contains. Task-ID 1875668
2018-09-20[FIX] mail: add missing abstract method in AbstractThreadAlexandre Kühn
2018-09-12[FIX] mail: filter messages in thread (Discuss)Alexandre Kühn
Revision on https://github.com/odoo/odoo/commit/ec8c505bc1c9ec21939e9ffef53a9cc6f63f30c7 The commit above changes the way threads are rendered: the template now uses a thread object, instead of a list of messages. However, it was not handling messages that have been filtered from the searchview. As a result, it was not possible to filter messages at all. This commit re-adds the possibility to filter messages, by providing information on the domain of the thread in the template. Task-ID 1877502
2018-08-30[REF] mail: clean some JS codeAlexandre Kühn
1. Removed `getLocalMessages` method in mailbox, and replaced with an override on `getMessages`. (This method was used before the distinction was made between `getMessages` and `fetchMessages`) 2. Removed unused method `_warnUpdatedUnreadCounter` in abstract thread window. (Leftover from an early POC) 3. Set the default value `''` for the status of a thread. (The method `getStatus` should always return a string) 4. Enforce default value `false` for detached status of channel. (The method `isDetached` should always return a boolean) 5. Improve readability of some tests. (removed useless variables and/or redundant code)
2018-08-27[FIX] doc building and warningsXavier Morel
doc: * fix incorrect doc comments (documenting params which don't exist) * correctly quote non-refs * fix role label syntax (backticks must be escaped) * add newline to fix warning JS doc parser: * fix handling of already-resolved objects * fix handling of non-string properties (e.g. foo[0] at module toplevel) * don't blow up if subject of .include call can't be resolved (just ignore) Others: * add translator support for ``problematic`` node (apparently used for some refs by recent Sphinx)
2018-08-21[IMP] mail_bot: change Odoobot to OdooBotXavierDo
2018-08-17[FIX] mail: misplaced translatable stringAlexandre Kühn
`_t()` must surround a static string in order to become a translatable string.
2018-08-13[IMP] mail, im_livechat: 'is typing...' indicator on mail channelsAlexandre Kühn
With this commit, most threads show an indicator when a member is typing something. e.g. "Mitchell Stephens is typing..." Supported threads: - DM - (public & private) channels - Livechat (Website & Backend) Unsupported threads: - mailboxes (e.g. 'Inbox') - document thread (= 'Chatter') - support channel (with `im_support` module) Some technical details: - This is a mix between 'start'/'stop' and 'regular notify' strategies. - On typing text in composer: notify 'start typing' to all members of thread. - On clearing text in composer: notify 'stop typing' to all members of thread. - A member can only notify once every 2.5 seconds to the server when he starts or stops typing something (throttled, buffered notify call). - On receiving a message from someone that is typing: determine that he is no longer typing. - On non-empty and unchanged composer text for 5.0 seconds: automatically notifies all members of thread that he is no longer typing anything. (This is like a 'soft / cooperative sender' timeout). - On non-receiving a typing notification of someone after 60 seconds: determine that he is not longer typing something (This is like a 'hard / receiver assumption' timeout). - When some types for more than 50 seconds straight: notify that he is still typing something (again and again every 50 seconds). - When two or more people are typing something (Multi-User channels), it displays at most 2 typing users (ordering rule: longer typers first): "Mitchell Stephens, Marc Brown and more are typing..." - Timing summary: - Usually 2.5 seconds uncertainty. - Up to 5.0 seconds uncertainty on typer inactivity. - Up to 60 seconds uncertainty on typer page reload / browser tab closed / etc. Future Improvements: - Detect page reload or browser tab close with loose of longpolling connection Task-ID 28188
2018-08-13[FIX] mail: do not increment unread counter on self-author new messagesAlexandre Kühn
2018-08-13[FIX] mail: messaging menu last message when receiving new messageAlexandre Kühn
Before this commit, when we received a new message, the counter was correctly updated, but not the last message in the messaging menu preview. This is due to making changes to the counter before adding the message in the thread. When there is a change in the unread counter of a thread, it warns its views. The messaging menu renders the previews of each threads in the preview items, using in particular the last message in the thread. This commit fixes the issue by making changes on the unread counter of a thread after the message has been added to the thread.
2018-08-13[REF][FIX] mail, im_livechat: various improvements (JS)Alexandre Kühn
This commit makes a lot of small improvements of the JS of mail and related modules. A. Mail Manager --------------- im_support: - [REF] Slightly more robust way to determine a support message, so that it more reliably falls back on default kind of message (i.e. support channel UUID should be clearly set). mail: - [REF] Improved method names for readability purposes. Some examples: - `fetchFromServer` becomes `fetchMailStateFromServer` - `_initialize{*}` becomes `_update{*}FromServer` - `_isModerator` becomes `_isMyselfModerator` - [REF] Use 'template' pattern design to make Include on Mail Manager much more robust. In particular, the flow is always as follow: 1. Initialize internal state. 2. Listen on buses. 3. Fetch mail data from server. - [REF] Improved workflow for thread window workflow (Shorter & more readable). B. Mail Tests ------------- - [REF] Thread Window Tests crashes with clean message when there are some thread windows open before running the tests. C. (Model) Message ------------------ - [REF] Improved method names for readability purposes (e.g. `isAuthor` becomes `isMyselfAuthor`). D. (Model) Thread ----------------- - [REF] Improved `init` parameters on each kind of thread. - [REF] 'Thread With Cache' has been renamed to 'Searchable Thread': it embraces all kinds of threads that can be used with the search view. - [REF] 'DM' has been renamed to 'DM Chat' (for clarity). - [IMP] New Livechat model in the backend. - [REF] No more direct instances of the Channel class: public and private channels are now 'Multi-User' channels, while DM Chat and Livechat are 'Two-User' channels: This change has been made so that instances of classes always have direct classes as "leaf" in the Class modeling. It eases making changes to a certain model without being too constrained by another model. - [REF] As a consequence of above changed, the method `isChat` has been renamed to `isTwoUserThread`. This is to avoid confusion with the terminology 'chat', which is more like a shortcut for 'quick real- time conversation'. In other words, the property of 'chat' depends of the way to interact on a thread, not of the intrinsic type of the thread. Still, some parts have kept the terminology 'chat', such as in the systray messagin menu. - [IMP] Added `message_added` and `message_posted` hooks, which may be useful to easily hook on those events. E. Thread Widget ---------------- - [REF] Now uses a `mail.model.AbstractThread` for the rendering of a thread, instead of a list of `{mail.model.AbstractMessage}`. - [FIX] Stick thread scroll height to bottom on new rendering, if it was previously at the bottom of the thread. - [REF] Option ORDER has its meaning changed: it now refers to the chronological order of messages in the thread, in which DESC means 'from top to bottom', while ASC means 'from bottom to top'. - [REF] Improved doc on templates, in particular with the option `ORDER`. F. Thread Window ---------------- - [REF] Moved more logic to thread windows, which were previously in Mail Window Manager. - [REF] Now hides the thread widget attribute. So instead of `threadWindow.threadWidget.isAtBottom()`, it uses `threadWindow.isAtBottom()`. - [FIX] New received messages when not having focus on Odoo tab should always make the corresponding thread windows "passive" (i.e. windows that keep threads unread until click on them). - [FIX] Blank thread window (i.e. 'New message' TW) correctly opens Discuss with 'Inbox' when clicking on 'Expand' Button in the title - [FIX] Do not display the composer for channels with property 'mass-mailing' set in thread windows. G. (Website) Livechat --------------------- - [REF] Some `trigger` have been turned into `trigger_up`. - [REF] Some logic has been moved to models (e.g. `{im_livechat.model.WebsiteLivechat}`), from `{im_livechat.im_livechat.LivechatButton}`. - [FIX] New messages should be received in real-time. The longpolling was broken with a recent refactoring on bus service (6448420c5dd160470e465dee7729d19d8d5e7bab).
2018-08-10[ADD] mail_bot, im_livechat_mail_bot: add Odoobot, your new best friendXavierDo
Purpose of this commit is to improve onboarding with a wow effect and a bot to test the Discuss app. Otherwise new users have nobody to talk to. Retention will be improved by both increasing interactions and onboarding of Discuss features. This commit adds a simple bot in discuss. It answers some questions, helps users getting their hand on discuss and eases the onboarding. In this version, the flow is quite simple, and only im_livechat adds some logic in order to show canned response. The logic is contained in new modules: mail_bot and im_livechat_mail_bot in order to keep everything well separated. It also allows users to remove the mailbot if they do not want to keep this functionality. Odoobot will only answer if he is in the onboarding conversation (alone with a user in a channel of type chat) or if a user pings odoobot. Odoobot logic applies to both standard chatter / channel messages and also transient messages (like help commands). Specifications * 2 minutes after first sign in, users will receive a direct chat from Odoobot; * make Odoobot an archived partner; * scenario * Odoobot: "Hello, I'm here to help you discover chat features. Try answering me with an emoji :)"; * User: Send emoji * Odoobot: "Great! :) Did you notice that you can also send attachments, like a picture of your cute dog? Try it!" * Odoobot: "Not a cute dog, but you get it :) To access special features, start your sentence with "/" (I.E. /help)"" * User: /help * Auto message then Odoobot: "Wow you're a natural! As a channel usually contain a lot of users, you can grab the attention with a ping. Try to ping me with @Odoobot!" * User: @Odoobot lorem ipsum * if Livechat installed * add 2 demo canned response so it does not look weird (like "Hello, how may I help you?" and "Have a nice day!") * Odoobot: "Perfect! <br> Try to type ":" to use canned responses." * User tries canned * Odoobot: "Good, you can customize your canned responses in the live chat application. <br><br> + réponse suivante" * Odoobot: "There's 3 different ways in Odoo to interact with your colleagues: via this chat window, [img of chat window] via the Discuss application [img of Discuss app + icon on it] or via the chatter [img of the chatter]. Aaaaand that's it! Enjoy discovering Odoo! :)" * random answers to ping/bad answer * "Mmmmh I'm not sure what you mean.. Can you try again?" * "I'm afraid I don't understand. Sorry!" * when someone pings @OdooBot with no reason: Odoobot: Yaaaay that's me! [party emoji] * fun stuff to add for some answer * User: i love you / love * Odoobot: Aaaaaw that's really cute but, you know, bots don't work that way. You're too human for me! Let's keep it professional <3 * User: Fuck * Odoobot: That's not a really nice thing to say, you know? I'm a bot but I have feelings, ok?! </3 This commit is linked to task ID 1838588 and PR #25075.