summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/messaging_initializer
AgeCommit message (Collapse)Author
2021-03-10[FIX] mail; hr: restore faster and more accurate mention suggestionsXavier Dubuc
The code from v13 used to look for partners in JS before making the RPC, which was much faster, and also gave better results by returning partners that were already known and therefore more likely to be selected. The same logic is reintroduced here, and further improved to take into account all known partners and sort them according to the likeliness they will be selected based on various criteria. task-2413776 closes odoo/odoo#64161 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Co-authored-by: Sébastien Theys <seb@odoo.com>
2020-12-07[FIX] mail, im_livechat: properly handle multiple public partnersSébastien Theys
task-2391334 closes odoo/odoo#62956 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-11-20[FIX] mail: prevent crash when initializing many failuresSébastien Theys
The test highlighting the current issue has been posted in PR https://github.com/odoo/odoo/pull/62076 But it is not included as part of the current PR because it is too slow to execute, while it is unlikely we will break this fix as it is not influenced by anything else in the code. The reason why we need this change is because on some database, including ours, we have users who have more than 1000 failures still unresolved and they are all returned at init. closes odoo/odoo#62090 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-27[FIX] mail, im_livechat: avoid artificially delaying messagingSébastien Theys
Don't delay the insert of partners or channels until it actually takes too much time. Don't await `_initMentionPartnerSuggestions` as it is just nice to have. task-2371485 closes odoo/odoo#60826 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-27[FIX] mail, im_livechat: allow to reopen closed chat in discussXavier Dubuc
task-2346862 closes odoo/odoo#60080 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-23[FIX] mail: force the model when creating basic threadDidier (did)
closes odoo/odoo#60285 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-23[FIX] mail: do not return members of channels in channel_infoSébastien Theys
This PR has 3 parts: The members fix itself, which is necessary for performance reasons especially at init messaging, as per described in the task. Adding the partner name in the typing payload, because due to not knowing all members anymore, it is necessary to properly display who is typing. Restrict restoring scroll position only if the corresponding scroll height is available, to make the scroll feature and particularly the corresponding tests more robust. task-2360020 closes odoo/odoo#60091 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-22[FIX] bus, mail: fix im_status for archived partnersThanh Dodeur
Before this commit, archived and deleted partners had not their im_status being updated automatically. There were some issues with this, notably: - odoobot 'bot' status was not displayed in chatter - im_status of partners becoming archived were not updated. This commit fixes both issues. task-2329591 closes odoo/odoo#60398 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-14[FIX] mail: adds shadow to RPCsThanh Dodeur
This commit adds shadow to RPCs that are not supposed to be blocking. task-2352703 closes odoo/odoo#59991 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-02[FIX] mail, im_livechat: consider all init channels as pinnedSébastien Theys
task-2347732 closes odoo/odoo#59023 X-original-commit: f1ac4bb61d1bc02c4b69dc31a2869fbd15852514 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-21[IMP] mail: reintroduce channel mentions, canned responses, commandsJulien Giannone
task-2280308 closes odoo/odoo#58166 X-original-commit: b63d0d2ee5f3bff24a5e1e1cd962d59bebef082d Related: odoo/enterprise#13392 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-04[FIX] mail, sms, snailmail: prevent message_fetch for hidden threadsXavier Dubuc
Automatically load messages from a thread cache only if the thread cache is used in at least one thread view. Ensure thread viewer don't keep thread view records alive when they are not displayed. This change is particularly important for performance, to avoid spamming RPC at init if many threads are opened in chat windows. task-2310623 closes odoo/odoo#57061 X-original-commit: dd6981c7812134e0588f80a157eaba45512cd68e Related: odoo/enterprise#12936 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-08-27[FIX] mail: 'Cannot read messagingMenu of undefined' tracebackAlexandre Kühn
Before this commit, on page reload, sometimes web client crashed with `Cannot read 'messagingMenu' of undefined`. This happens due to messaging components making use of `messaging` in `env` as if it was always set. In some rare cases, this is false, hence the crash. This happens on root components of messaging such as the messaging menu. Creation of `env.messaging` has to be async, in other to ensure all JS module that patches messaging are applied. The mounting of messaging root components depends on other parts of the web client like the SystrayMenu. So the proper fix is to guard `env.messaging` on these root components. Task-2238245 closes odoo/odoo#56682 X-original-commit: d1483ff3c83bb3146e80e5d65a27915c5b2a2bf9 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-13[IMP] web, *: improve mock server and replace most mail mockRPCSébastien Theys
Improve mock server: - add support for mocked `fetch` - add support for `active_test` - add support for x2m `in` in domains - add support for default values computed from a function - implement a more natural "next id" compute - allow initial data without ids - ensure write and x2m commands integrity - improve bad data/bad commands error messages - always warn for failing RPC, not only in debug mode - fix all existing tests that had inconsistency data Other changes done in mail (or dependents) that are not just related to tests: - remove `direct_partner` from formatter result ->`correspondent` can be computed from other keys, especially `members` - fix `livechat_visitor` convertData -> only process if there is value - add `current_partner` and `current_user_id` as `init_messaging` result -> easier to mock than session - remove usage of `need_moderation` -> that was just a search indirection to `moderation_status` - adapt `partner_id` -> `res_partner_id` key in `_notification_format` -> to be consistent with field name - add name in result of `mail_partner_format` -> sometimes display_name is not the same - remove usage of `is_moderator` -> that was just an indirection to `moderation_channel_ids` Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523 task-2287171 closes odoo/odoo#55854 X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d Related: odoo/enterprise#12391 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-06[FIX] mail: process result of init messaging asynchronouslySébastien Theys
Part of task-2308312 closes odoo/odoo#55562 X-original-commit: bdc2a9f516562c854837248e7d0898e5cfc8dec1 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-07-31[FIX] mail: batch create/insert of JS model for performanceSébastien Theys
PR: #55261 Part of task-2308312 closes odoo/odoo#55266 X-original-commit: eded5f6372d4f1cffd1a361bd8fa7fd8f1f8ae9e Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-26[FIX] mail: discuss: unpin channel fixesLucas Perais (lpe)
FIX: use the correct API of mail.channel.py to unfollow a channel i.e.: `execute_command_leave` FIX: unpinning a channel has immediate effect on the interface chatWindows are closed, and the inbox is displayed FIX: unpinning a channel destroys corresponding chatWindows across tabs It also unpins the channel in other tabs FIX: python sends is_pinned as part of the channel_info both at init messaging and in the main bus notification That way, we can keep track of the synchronization of the pin status between JS and python task-2275000 task-2267941 closes odoo/odoo#53703 X-original-commit: d4fcc64acb2fc0c6fd9df505380f665abd8b39c4 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-06-15[REF] mail, *: refactor messaging with OWLSébastien Theys
This commit is a significant rewriting of client-side discuss, chatter, chat window, and messaging menu using OWL. The behavior should be broadly the same, with some slight functional changes here and there. From a technical standpoint, the code of messaging is mainly organized in 2 main groups of modules: - models, which are logical entities that depict the client-side state of messaging as a whole. - components, which are in charge of displaying information from models. This refactoring also introduces new JS guidelines regarding folder structure (/static) and naming rules for JS modules. Community PR: https://github.com/odoo/odoo/pull/39023 Enterprise PR: https://github.com/odoo/enterprise/pull/6249 Task-1914207 This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier, with the precious help of Lucas to speed it up towards the end. closes odoo/odoo#39023 Related: odoo/enterprise#6249 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com> Co-authored-by: Alexandre Kühn <aku@odoo.com> Co-authored-by: Julien Giannone <jgi@odoo.com> Co-authored-by: Lucas Perais <lpe@odoo.com> Co-authored-by: Sébastien Theys <seb@odoo.com> Co-authored-by: Xavier Dubuc <xdu@odoo.com>