* = im_livechat, test_discuss_full
According to stats from our production database, this query is 10 times
faster than the one generated by the ORM by using a `left join` rather
than `id in`.
closesodoo/odoo#125961
Related: odoo/enterprise#43635
Signed-off-by: Didier Debondt (did) <did@odoo.com>
This commit adds a GIF picker in discuss
app. GIF feature makes use of Tenor GIF API [1].
To enable GIF picker in discuss, you must provide
a Tenor GIF API key in the General Settings.
Then the GIF picker is visible in all channels
(chat window and discuss app), next to the emoji picker
button.
[1] https://tenor.com/gifapi/documentation
task-2365705
closesodoo/odoo#116060
Related: odoo/enterprise#41959
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
This PR fixes some issues present in the livechat demo data:
- anonymous name should be given to the channel, and should be the
name of the visitor not the one of the channel.
- odoobot should not be a member of the channel (done by default
when creating a channel but making those channels that are supposed
to be one-to-one channels a group channel)
At the same time, this PR fixes an issue with the thread model that
contained clear commands instead of null value.
part of task-3332872
closesodoo/odoo#126219
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, a new unread message could contribute to unread
counter of conversation twice.
Steps to reproduce:
1. Log in as Demo and start a conversation with Mitchell Admin
2. Log in as Admin: if this is the first message in the conversation,
counter is correct and shows (1)
3. Log out as Admin
4. Send another message to Admin
5. Log in as Admin and notice that the counter is doubled
6. If the conversation was still open, counter is correct!
This happens because some notification are pending dispatch before
fetching messaging state initially. The counter at init_messaging
fetch takes into account the notification. However, when handling
the message notifcation, it's wrongly considered as a new
notification, thus incrementing the counter when it shouldn't.
This commit fixes the issue by fetching the last bus notification
when fetching init_messaging. Doing so allow to determine whether
a notification is newer or older than init_messaging state.
This helps deciding whether the counter should be incremented or not.
Task-3357960
closesodoo/odoo#124767
X-original-commit: 081ab772dece86f1b5a5d4b3f6227b4b311d9206
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
1. Display avatar in top bar next to channel name and description.
2. Edit icon appears on hover.
3. Clicking on the Edit icon opens file browser to upload a new avatar.
4. Certain file types are allowed.
5. Avatar can only be changed for group chat by any member of the channel.
6. For channel it can be done with admin rights.
7. Disable uploading text from file uploader in this case.
Also show avatar of channel/chat conversation in chat window.
Author avatar in message list no longer shown im status.
Chat window header color matches new systray color.
task-2684679
[FIX] mail: make chat window header match systray color
Part-of: odoo/odoo#117357
* = bus, calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot,
mass_mailing, privacy_lookup, test_discuss_full, test_mail,
test_mail_full, website_crm_livechat, website_livechat, base
In preparation of splitting discuss and mail modules.
Part of task-3265211
closesodoo/odoo#118354
Related: odoo/upgrade#4553
Related: odoo/enterprise#39661
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Adapt code of message fetch so that fetching of
(needaction) messages are controlled in a way to
keep continuous sequence of messages at all time.
This code design solves the "holes" problem in a message
list by not allowing holes. This fixes many scenario that
generated these holes, resulting in unfetchable messages.
Example of such a scenario:
- post 40 messages
- post a new message that is reply of the oldest message
- page reload and scroll up until load more
=> 10 messages are missing in-between replied message and
following message (that should have been 11 messages apart)
This code also prepares for allowing jumps in a conversation.
Part-of: odoo/odoo#116666
`PartnerRoot` is a confusing name for what is in fact what everyone call `odoobot`
closesodoo/odoo#116823
Signed-off-by: Debondt Didier (did) <did@odoo.com>
Update to current runbot state, in order to better spot changes potentially
introduced with this PR.
Task-2710804 (Mail: Clean MailThread Posting API)
closesodoo/odoo#106182
Related: odoo/enterprise#34197
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: im_livechat, website_livechat
Access right should be based on channel type and membership instead.
Chat always private, group always private, channel private should
disapear and be a group instead (migration needed), and other channel
always public (but they can still be further restricted with
the "allowed groups" feature)
task-2632861
closesodoo/odoo#90415
Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = bus, hr_holidays, test_discuss_full
- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly
task-2664853
closesodoo/odoo#98923
Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is the continuation of task-2948676 which consists of
lightening the Thread model by moving the channel-specific behaviours to
the Channel model.
The changes revolve around the DiscussSidebarCategoryItem model. The
goal is to use channel instead of thread as identifying field for
DiscussSidebarCategoryItem, and to move channel-specific fields involved
in the computes of this model from Thread to Channel.
Changes in this commit include:
+ move `avatarCacheKey` from Thread to Channel
+ move `correspondent`
+ move `correspondentOfDmChat`
+ move `custom_channel_name`
+ move `localMessageUnreadCounter`
+ move `serverMessageUnreadCounter`
+ introduce `Channel/displayName`
+ use channel instead of thread as identifying field for
DiscussSidebarCategoryItem
Part of task-2948676.
closesodoo/odoo#98149
Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Automatically add readonly on computed and related fields. This commit
required to rewrite some preexisting fields to make them readonly.
Task-2955927.
closesodoo/odoo#98541
Related: odoo/enterprise#30625
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = calendar, im_livechat, rating, snailmail, test_discuss_full, test_mail,
website_livechat
Distinction between "replace" and "insert-and-replace" can be guessed based on
the type of the provided data.
task-2957295
closesodoo/odoo#98404
Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Current behavior
Starred messages counter takes into account the starred messages of a private
channels even if we no longer have access to this channel. Happens with deleted
messages too.
Steps channels
- Install Discuss
- Create a Private Channel and invite Marc Demo to join it
then send him a message
- *As Marc Demo*, star the message then leave the channel
-> Starred counter still shows 1
Steps for deleted messages
- Join the private channel again
- Delete the starred message (with Mitchell Admin)
-> Starred counter still shows 1 for Marc Demo
Reasons
Starred message count is computed by a raw sql [1] which only counts partner's
occurrences without taking into account the message's state and/or the
associated channel.
Side records (stars, notifications) are not removed when emptying a message
content [2].
With changes
- It doesn't take into account messages from a private channel which we no
longer have access to by doing a search on mail.message instead of doing it
in SQL (which filters out invisible messages);
- It correctly voids side records when emptying messages;
Side effects
This somehow raises number of queries because we now check access on messages
and records. However this is necessary as bypassing ACLs means unreachable
notifications or stars.
OPW-2742092
Task-2813738
[1] : https://github.com/odoo/odoo/blob/2c1c6b1373c238216fda1e2d9d2f00b5d16c8ca3/addons/mail/models/res_partner.py#L49-L51
[2] : 776d1ee08bclosesodoo/odoo#97974
X-original-commit: b1e8f7d97e3a1fa624436d2dd6801bf5fe7d19aa
Related: odoo/enterprise#30415
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As the name suggests, `channel_type` only makes sense for Channel.
This commit moves `channel_type` from Thread to Channel.
* = im_livechat, test_discuss_full
Part of task-2948676.
closesodoo/odoo#97779
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* test_discuss_full
channel invitation to rtc calls are now using the `ChannelMember` and
`mail.channel.partner` models instead of the `partner` and `guest`
models.
part of task-2692836
closesodoo/odoo#95898
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = im_livechat, test_discuss_full
Various improvements to user settings, including:
+ Introduce new js models `res.users.settings` and `res.users.settings.volumes`
to mirror the python models.
+ Avoid reformatting server data and simplify the way notifications are handled.
+ Clean dead code (unused convertData).
+ Reword and add documentation.
closesodoo/odoo#93390
Related: odoo/enterprise#28291
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Update to latest runbot state, at least for tests known to be
deterministic.
Notably mail tests are lower than before, probably due to odoo/odoo#73271closesodoo/odoo#93470
X-original-commit: 6118ecba8d807ac5ebc69ae4877e1f202b0daeb1
Related: odoo/enterprise#28308
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Move expected init_messaging results in a getter so that it can be
overriden.
Needed for task-2821508 that adds fields to the model
`res.users.settings`, whose the content is returned by init_messaging.
Part-of: odoo/odoo#90015
The only mail.channel rule was that a user only had access to channels
they're members of, or can subscribe to (public, or group based).
This rule applied to admins as well, forcing them to switch to
super-admin mode in order to manage mail channels.
This is undesirable on lots of axis:
- superadmin mode is a bit of a last-ditch feature, as a result it's
somewhat hidden
- there is a much higher risk of screwing up as superadmin mode
basically lifts all the access rules, which can have correctness
implications
- auditing completely breaks down when using superadmin mode, as the
real identity of the user is lost
OPW-2857136
closesodoo/odoo#92299
X-original-commit: 1a77ab5726bbcc477d12f40f67433d474ea85316
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Before this PR, nothing warned the user that the invitation link was restricted to
a user group.
task-2818094
closesodoo/odoo#88562
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit aims to improve the time off experience by:
- fixing the "cancelled" ribbon on time offs
- removing the archive dropdown action
- removing the "off until" banner in discuss if the user's leave is not validated
TaskID 2800647
closesodoo/odoo#87650
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Other data are not actually used. This will improve performance a bit (less
queries, less data to return) until the need to return this list goes away (it
requires a bigger refactoring).
task-2847983
closesodoo/odoo#91576
X-original-commit: 61e472aa35ac825553144fd9a80fbf62e3e8b5e1
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This PR prepares the ground for the one introducing the new environment in the
mail module. Indeed, the mail_bot messaging_initializer relies on the session
in order to known when to initiaze odoobot. With the new env, we won't be able
to access the session but will instead override init_messaging to automatically
initialize odoobot. Doing this first reduces the noise in the main PR.
task-2582313
closesodoo/odoo#90291
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit:
In discuss, the group DM default name does not contain any guest names in it.
After this commit:
Group DM default name will also take guest names along with other user names.
Task-2664859
closesodoo/odoo#86130
X-original-commit: 41f4c5741097b09c372406bbbd5364314bff6d1b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Purpose is to update counters according to current runbot's state. This eases
checking impact of future performance improvements done.
Task-2631088 (Appointment: profile and add performance tests)
closesodoo/odoo#85838
X-original-commit: b0c7a6397526ad2698fac0701e4323c019ea8bf6
Related: odoo/enterprise#25002
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Invalid data provided at record creation were silently skipped by the
framework without triggering an error. This commit ensures that data are
no longer accidentally filtered and therefore that an error will be
raised if a key that does not match an actual field is provided.
This commit also removes the dead code that was detected thanks to these
changes.
closesodoo/odoo#81909
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, it would fetch all channels partners of all channels, even
for big channels and for members that were not useful to known anything about.
This commit reduces the number of fetched members to a more reasonable level,
and ensure the formatting of those members is done only once, instead of once
per channel.
Time goes from 90ms to 1ms for 1000s of members in 100s of channels.
Part of task-2702450
closesodoo/odoo#81262
X-original-commit: 89419b593ed163a8b174945e80f1c36c9cf78257
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Forcing a fetch of all channel partners for all channels is not efficient
because there are too many of them.
Replace by a count done in SQL through `read_group`.
Time goes from 100ms to 3ms for 1000s of members in 100s of channels.
Part of task-2702450
closesodoo/odoo#81175
X-original-commit: 7c77775a84474ccdfe32bdd783291728fbfbdc42
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
* = test_discuss_full
Before this commit if 2 persons are joining the call at the exact same time, the
join RPC of each will return the list of RTC sessions without the other person
included.
In more general terms, the server should actually rarely send the full state to
the JS (in this case "use the replace command") because there is no guarantee
that a concurrent transaction is not changing the data at the same time. In
other words, even the python is actually working with partial knowledge
relatively to the database.
Using a DB lock would guarantee it, but we don't want to lock tables and wait on
locks if there are alternatives. In this case it is acceptable to keep obsolete
sessions for a little bit longer, as long as they are cleared eventually.
closesodoo/odoo#77656
X-original-commit: d3a84172fc78f5783f75aa1155f1a25e4f9614b7
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
- Add a new stand-alone page "WelcomeView"
- Redirect people who join using an invitation link to the WelcomeView
- Add microphone/camera preview
- Allow guests to choose a name from the WelcomeView
- Add "Start a meeting" button to the discuss sidebar
- Create a new channel on click on the "Start a meeting" button
- Display ChannelInvitationForm on click on the "Start a meeting"
button
- Add a new field to `mail.channel` in order to define the display
mode to use for videos (e.g full screen) when joining a meeting
Task 2494829
closesodoo/odoo#75899
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*test_discuss_full,test_lint
This commit adds the audio and video conference feature to mail channels
and integrate it with the groupDM/guest features.
Adds new mp3 and ogg files (from task-2554674) for sound effects.
- Adds three new tables:
* `mail.channel.rtc.session` to manage the peerToPeer interactions
during rtc calls.
* `mail.ice.server` to provide ICE servers necessary to establish
peerToPeer connections with webRtc.
* `res.users.settings.volumes` to hold the partner-to-partner volume
settings, each partner can create one new setting per other
partner to configure the volume coming from those partners during
calls.
- changes res.config.settings:
* Adds new fields for the Twilio credentials to use their STUN/TURN
service.
- changes res.user.settings:
* Adds 4 fields for the push to talk and voice activation.
- changes mail.channel:
* Adds a new field `rtc_session_ids` that represents the active
participants in a rtc call on that channel.
- changes mail.channel.partner:
* Adds a new field `rtc_inviting_session_id` that represents the
rtcSession of the user that is inviting that channelPartner to a
call.
task-2366708
closesodoo/odoo#66611
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Purpose
=======
Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.
- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
for each employee.
In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
simple use case. But in USA, it's possible to change the calculation mode each year.
Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
Improvement of global time off feature located on Working hours calendar. Now, Time off
application have to manage Public Holidays.
- Review of Time Off type configuration
COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413
closesodoo/odoo#72511
Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
snailmail, survey, test_discuss_full, test_mail, web_editor, website,
website_livechat
- Create new model `mail.guest` for guests.
- Rewrite some RPCs to target routes rather than model methods so that
guests are able to use them.
- Patch JS and python models to support guests.
- Create a stand-alone page and boot the channel in it.
task-2494829
closesodoo/odoo#75496
Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
- Channels
* "hash tag" avatar with different backgroud colors
* only private channels have lock thread icon
- DM groups
* "users" avatar with different background colors
* no thread icon
task-2584994
closesodoo/odoo#75653
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>