Commit Graph
3358 Commits
Author SHA1 Message Date
Sébastien Theys 94d9a31018 [FIX] mail: fixup of 8af59b95b477b
task-2388659
2021-08-26 15:40:31 +02:00
Didier (did) 1afcc9c368 [IMP] bus, mail, *: improve longpolling bus notification format
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
    web_editor, website_crm_iap_reveal, website_livechat

The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.

Notification are now defined with 3 distinct parts:

- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it

Channel
=======

Business code
-------------

- Record channel is introduced for ease of subscribing to and sending
  notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
  channel).
- Tuple channel is still supported without any change (but should be avoided
  whenever possible due to its complex syntax).

The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.

Technical note
--------------

All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).

Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.

Type
====

Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.

In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.

Payload
=======

Payload (ex message) did not change, it can still be anything depending on
business needs.

Few adaptations:
- When the type was included on the payload, the type has been moved to the new
  type parameter.
- When the channel was used in business code, its data has been copied into the
  payload.

task-1891151

closes odoo/odoo#79201

X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 16:05:23 +00:00
Nicolas Lempereur ad6568444d [FIX] mail: activity view=>no tz for deadline date
In activity view, the deadline date that has no timezone is formatted
from UTC to local timezone, so if the timezone is negative, we display
by error the previous day (eg. 24 october instead of 25 october).

With this commmit, we interpret the date in local timezone so there is
no timezone issue.

note: no test added since this only happen on browser with negative
timezone which would be hard to test.

note: this was fixed similarily in 13.0 with 0735547086 but must have
been lost in a refactoring.

opw-2629681

closes odoo/odoo#78938

X-original-commit: 8935899c6fdc21ad6eff9f09af6e474652efbcd2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-10-26 13:22:49 +00:00
Didier (did) d32256c051 [FIX] mail: display the call indicator on mobile
and in the notification zone.

part of task-2634175

closes odoo/odoo#78865

X-original-commit: 88fc69c06e4f1516c8d95812395f1e2fbf10f44c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-25 09:53:20 +00:00
Romain Estievenart 2c9da836e5 [FIX] mail: keyboard shouldn't pop on WebRTC call on mobile devices
Steps to reproduce:

1. Log on odoo with a user A on mobile device
2. Log on odoo with a user B on desktop
3. User B call user A
4. User A answer the call and the keyboard popup on the screen => BUG

To avoid this behavior, we disable the input auto-focus when we open a
chat window like other chatting app on mobile devices (like: Signal,
Messenger, WhatsApp...)

closes odoo/odoo#78864

X-original-commit: cf36921df8dff114f26a161c4f9d2f6a05ac2adb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-25 09:53:16 +00:00
Alexandre Kühn e8f1d86c95 [REV] mail: memleak model manager in tests
This reverts commit 4c18e2d09a372e975c2133516cc9bdd1880b2c1b.

This commit makes a barcode qunit test crash non-deterministically,
but quite frequently (50% of the time).
At the time of reverting this commit, we still don't know how this
commit affects this barcode test, but it's urgent to resolve by
revert and understand more in depth what are the causes.

closes odoo/odoo#78827

X-original-commit: 29eb6d3e5ea859955290a2c3f53908b80e16f03e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-22 13:07:46 +00:00
Krunal Trivedi b39a2ca3a8 [FIX] mail: fix attachment removed when editing message
when a message or logenote with attachment(s) is edited attachment gets removed
even if user does not want to delete attachment.

after this commit,
editing message text will update only message and attachment will not be removed.
attachment will be deleted only when user wants to delete it

closes odoo/odoo#78785

X-original-commit: dbd6cf34d3fcf9d66657b68766d2a25ee0d2515b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-21 22:18:44 +00:00
Louis Wicket (wil) 7c76f29111 [FIX] mail, web: properly add messaging menu to the systray
This commit intends to fix two strange bugs encountered while trying to
push a new component into the systray menu:
- MessagingMenuWidget and RtcActivityNoticeWidget were removing their
parent node via DOM manipulations when attached in the DOM. This caused
a crash when adding other items to the systray menu since the deleted
nodes were actually managed by OWL.
- The t-foreach directive in the navbar used indexes as the t-key, which
led mapping items subsequently added to wrong templates.

closes odoo/odoo#78784

X-original-commit: 5f0f80da4fc951954d253c9e45defd591605f556
Related: odoo/enterprise#21829
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Ooming <oomsveta@users.noreply.github.com>
2021-10-21 18:02:06 +00:00
Louis Wicket (wil) 92c47e5fbb [IMP] mail: enforce the definition of identifying fields in models
Ensure that all models have their own explicit definition of identifying
fields. Prior to this commit, if a model did not have identifying fields,
the ones in mail.model were used implicitly because of the inheritance.

closes odoo/odoo#78722

X-original-commit: 02fb0c7caaa8a9813e7e78b464710eb772091e44
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-21 09:56:51 +00:00
Alexandre Kühn 6f56216533 [FIX] mail: memleak model manager in tests
closes odoo/odoo#78726

X-original-commit: 4c18e2d09a372e975c2133516cc9bdd1880b2c1b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-21 08:39:48 +00:00
anhe-odoo 532fd04718 [FIX] mail: chatter in chat window should log notes
Expected Behaviour

When a user reply to a mention (on an invoice, a client profile, ...) in a log_note, and this user answers directly in the chatbox, the answer should be considered as an internal discussion, and so be posted as a log_note.

Observed behaviour

Since V12, when a user reply in the chatbox, the reply is automatically set as a "send-message" reply, which is a issue as the user sends an email to all followers of the discussion while he probably thinks his answer will be visible only by the internal users.

Reproducibility

This bug can be reproduced following these steps:
1. Declare at least 2 users (A and B) and make sure user A handles notifications in Odoo
2. Log as user B, go anywhere in Odoo as user B and mention the user A in a log_note
3. Log as user A, open the mention notification and reply in the chatbox
4. The answer will be noted as a send-message answer, sending then e-mails to all followers ...

Problem Root Cause

As long as the V12 isn't supported anymore, we didn't investigate this version. In V13, the issue comes from the fact the chatbox didn't use the same composer class as the discussion module, and then it's not possible to send a log note from the chatbox. In V14, as the discussion module has been totally refactored, the "error" comes from the arbitrary choice to set "false" as the default value of "isLog" on a general message, which implies that the answer from the chatbox is considered as a "send-message" and not as a "log-note".

Related tickets

opw-2602712
opw-2659484

closes odoo/odoo#78565

X-original-commit: 9e62872561f9914beac8f58f5c3ebed83cd9defc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-18 15:13:03 +00:00
Mohammed Shekha 895498c616 [FIX] mail: pass default_activity_type_id in context
Before this commit: when creating scheduled activity from activity cell
activity type was not passed in context due to which default activity type not
set, to produce: CRM -> Activity View -> Click on existing record of activity
view which will open popover -> click on Scehdule Activity button, this will
open scheduled activity form but it will not have default activity type.

After this commit: when clicking on Scehdule Activity button from activity
popover, default activity type will be passed in context.

task-2568793

closes odoo/odoo#78330

X-original-commit: 17cbafdd1ce4f5f095512677d5b3750e3a8dc889
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-10-13 18:24:47 +00:00
Didier (did) 2e2b49931f [FIX] mail: add the ability to invite on mobile
Before this commit, it was impossible for a user to invite people to a channel
or a group DM.
This commit add the invite button on the chat windows header only on mobile.

Part of task-2634175

closes odoo/odoo#78267

X-original-commit: 56ab9ffea28dd5f22a74ba269cbd5552c42953e3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-12 19:17:43 +00:00
Thanh Dodeur 08a60701ac [FIX] mail: remove behaviours dependent on connectionState
Before this commit, there were some usages of
RTCPeerConnection.connectionState which is not available on some
browsers, including Firefox.

This commit fixes this issue and make it so that we only use
RTCPeerConnection.iceConnectionState instead.

closes odoo/odoo#78064

X-original-commit: 297442f72e23bc1a03ea857699fcae20b5cd0bbc
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-08 16:09:21 +00:00
Louis Wicket (wil) 0b34db239c [IMP] mail: clean up of the guest rename code
Minor changes:
- properly discard the rename when exiting an empty input
- uniformize case: TopBar -> Topbar
- update documentation
- move avatarUrl from component to model

closes odoo/odoo#78029

X-original-commit: 8d6199ac64472505ef378b94a84dc1045916557a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-08 16:09:01 +00:00
Samuel Degueldre cd4fc7786e [FIX] mail: fix crash when clicking a reply that is not yet loaded
closes odoo/odoo#78030

X-original-commit: 913c33c3938600353b2f607dd4142e86592890ce
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-10-08 07:20:06 +00:00
Louis Wicket (wil) 1a1c4e3547 [IMP] mail: keep url params in discuss public view
This commit will change the way URLs are edited in discuss public view
to preserve URL params in the resulting URL.

Context:
In order to avoid leaking invitation links, URLs are modified in discuss
public view, but this can sometimes hide precious information such as
the debug mode from the URL.

closes odoo/odoo#78019

X-original-commit: 0a3b31c615bb319b4e0d9304e034df3520e8f33c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-07 18:00:00 +00:00
Sébastien Theys deeac9a935 [FIX] mail: don't show media preview on guest page if not meeting
closes odoo/odoo#77939

X-original-commit: 51eb2c9d08354e0294b7a8737743fec3de1c291d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-07 14:17:27 +00:00
Sébastien Theys 0adc10c20a [FIX] mail: update guest avatar on rename also in RTC card
closes odoo/odoo#77962

X-original-commit: 6020dba4856a0e8822829eaa0ff9f8c2b2a252a1
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 13:51:08 +00:00
Louis Wicket (wil) 021bc1bfd8 [IMP] mail: open and join call on click on the start a meeting button
Automatically create and open a new channel, then start a call, on click
on the "Start a meeting" button.

Part of task-2651831.

closes odoo/odoo#77946

X-original-commit: cedc8e934bf8c97f94f455389315f9f4c40137c7
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-06 10:27:12 +00:00
Samuel Degueldre ceea5f7852 [IMP] mail: allow users to reply to other messages in discuss
This commit adds a feature where users can reply to messages of other
users, doing this will show a reduced version of the message that has
been replied to above the message once posted, clicking on this reduced
version will scroll to the original message and highlight it if that
message is already loaded.

task-2362251

closes odoo/odoo#77941

X-original-commit: cec2e69e832072dd699274187ddfa122e29d03f3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-10-06 07:03:59 +00:00
Didier (did) f56d11e45b [FIX] mail: add attachment deleted notification
Before this commit, when an attachment is deleted, there is no notification and
other client do not update the attachment status.

task-2635516

closes odoo/odoo#77937

X-original-commit: aa4d7920574852d0543e22a30fc686a7d41f9867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 02:09:07 +00:00
Louis Wicket (wil) 71f6d736cc [IMP] mail: add rename guest button
This commit will display the name of the current guest in the thread
view top bar and make it editable.

closes odoo/odoo#77936

X-original-commit: 659c6a83245a396054cf26c204a7fc72fbbb971f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 02:09:03 +00:00
Louis Wicket (wil) 3ffad9f8a0 [FIX] mail: open attachment viewer in public views
Click on an attachment from a public thread view will now open it in an
attachment viewer.

closes odoo/odoo#77932

X-original-commit: 550dc40b022cd3b11440a1767df4d857d9fd12a9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 02:08:59 +00:00
Samuel Degueldre e31464db54 [FIX] mail: stop squashing message if the previous message is deleted
closes odoo/odoo#77922

X-original-commit: 92c7f11e3c3cc70a3d520f0977f474e55dc7bced
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 19:13:38 +00:00
Thanh Dodeur af015814f6 [FIX] mail: prevent traceback when the audio of a peer is loaded
Before this commit, we would reset the audio of a peer before setting a
new one which is not necessary as the track remains the same for the
whole lifetime of the transceiver (and therefore the peerConnection).

Moreover, calling `pause` on the audioElement could lead to a race
condition with the following `play` and lead to a traceback.

closes odoo/odoo#77883

X-original-commit: e0b957cd3cd657ad15168e35fdaaeebccb7be4be
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:42:04 +00:00
Thanh Dodeur e6fbdb91c8 [FIX] mail: remove the dataChannel entry when removing a peer.
Before this commit, the entry in `mailRtc._dataChannels` was not removed
when removing a peer, which meant that `mailRtc._dataChannels` could
contain old closed dataChannels. Moreover, the call to `close()` on the
dataChannel was not guarded, which could lead to tracebacks.

For example, if a peer was removed before creating its dataChannel (like
in crashes or successive connection recovery attempts), `close()` was
called on `undefined`.

this commit fixes this issue.

closes odoo/odoo#77880

X-original-commit: da3fce19157a07fc1abbb6d188746d4a00d3a344
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:41:51 +00:00
Thanh Dodeur 023eee86f4 [FIX] mail: prevents frozen video elements
Before this commit, when a video track ended unexpectedly, the peers
were not notified that the remote track ended, which made it so that
inactive video elements remained on screen.

This commit fixes this issue.

closes odoo/odoo#77875

X-original-commit: d868582b2b409ec01bc4983429dea723f27f5513
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:41:38 +00:00
Sébastien Theys 3a87aaf914 [IMP] mail, *: clean up message component by introducing view model
* = hr, hr_holidays, sms, snailmail, website_livechat

Message model incorrectly contained data related to a specific component (only
one) even though there can be multiple message components per message model.

This cascaded to adapting related component/models to the same principle.

closes odoo/odoo#76718

closes odoo/odoo#77779

Related: odoo/enterprise#20964
Related: odoo/enterprise#21426
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:40:49 +00:00
Sébastien Theys 2f700dd9a7 [FIX] mail, *: avoid concurrency issue of RTC sessions
* = 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.

closes odoo/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>
2021-10-04 09:16:19 +00:00
Sébastien Theys 71452c334f [FIX] mail: remove annotateTraceback because it is extremely slow
It could take seconds to annotate a simple stack trace, it is therefore not
suited at all for quick logging as we do in RTC.

It's unfortunate but acceptable to just log the non-annotated stack trace in
that case.

X-original-commit: 8b3495c489c274e878d2a0938ea29b4da17710aa
Part-of: odoo/odoo#77656
2021-10-04 09:16:19 +00:00
b63ee52552 [FIX] *: remove scss 'extend' from dropdown components
This commit removes all the 'extend' initially introduced to avoid code
repetition and ensure visual consistency across Bootstrap and Owl dropdowns.

Despite achieving the desired results, using 'extend' in this context
was seriously impacting the bundle generation time, probably due to an
underestimated amount of Apps' legacy-code applied on these elements.

In order to achieve the same results, the chosen strategy is to add
Bootstrap default classes directly into Owl dropdowns.
Also, it moves code related to bootstrap dropdown in 'webclient.scss',
leaving 'core/dropdown/dropdown.scss' for Owl code only.

Due to the discrepancies between Bootstrap and Owl html
structure, the '.dropdown-item' class could not have been added
directly to Owl's '.o_dropdown_item' itself, without refactoring
the Dropdown component structure.

// ==== Bootstrap 4.6 default Structure ================================
<div class="dropdown-menu">
  <button class="dropdown-item" type="button">Action</button>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== OWL default Structure before this commit =======================
<ul class="o_dropdown_menu">
  <li class="o_dropdown_item">
     <span>Action</span>
  </li>
  <li class="o_dropdown_item">
     <a href="#">Another action</a>
  </li>
</ul>

// ==== OWL Structure after this commit ================================
<div class="o-dropdown--menu dropdown-menu">
  <span class="dropdown-item">Action</span>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== web.assets_backend.css Bundle Generation Comparison ============
With all modules installed (enterprise edition over runbot):
Before this commit, bundle took ~2.5s and ~4s to generate and weighted ~322kB (~2.5MB uncompressed)
After this commit, it takes between ~1.2s and ~1.6s and weights ~257kB (~1.6MB uncompressed)

closes odoo/odoo#77649

X-original-commit: 84715436d87bb05b421bc9ccaacda67d07571690
Related: odoo/enterprise#21370
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Co-authored-by: François Georis <fge@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-04 07:57:00 +00:00
Romeo Fragomeli 1b0f165a2f [FIX] mail: restore the scroll behaviour of control panel on Mobile
Given that we have a viewport of 320px and, to simplify the explanation,
we discard the height of the <header> (aka. the top navbar).

Since the refactoring of Discuss [1], a global rule was added to the
'.o_action_manager' to allow the flex to shrink the discussion's list
in Discuss on Mobile.

But this rule change the box sizing of '.o_action_manager' as now it
takes the minimum size (e.g. before 3000px became now 320px +/- the
height of the viewport).
Therefore a limit for the sticky-scroll behaviour of control panel is
set at the end of the height of the element.
Then when the viewport goes outside this limit the sticky doesn't work
anymore until the viewport returns before this limit.
(e.g. <= 320px ok, > 320px ko).

The fix is to change the flex basis of the '.o_Discuss_notificationList'
to be 0 which avoids to alter the global '.o_action_manager' and scopes
rules to Discuss' specific classes.

DOM before this commit:
┌───────────────────────────────────────────────────────┐
│ '.o_action_manager'                                ▲  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                     ELEMENT HEIGHT │  │
│                                       = 'VIEWPORT' │  │
│                                              320px │  │
│ ┌────────────────────────────────────────────────┐ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │        Control Panel                           │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ └────────────────────────────────────────────────┘ ▼  │
│ - - - - - - - - LIMIT OF STICKY ELEMENT - - - - - - - │ <- 320px
│                                                    ▲  │
│                                                    │  │
│                                        OVERFLOW    │  │
│                                        VISIBLE     │  │
│                                                    │  │
│                                                    ▼  │
└───────────────────────────────────────────────────────┘

DOM after this commit:
┌───────────────────────────────────────────────────────┐
│ '.o_action_manager'                                ▲  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                                    │  │
│                                     ELEMENT HEIGHT │  │ <- 320px
│                                     >=  'VIEWPORT' │  │
│                                             3000px │  │
│ ┌────────────────────────────────────────────────┐ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │        Control Panel                           │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ │                                                │ │  │
│ └────────────────────────────────────────────────┘ ▼  │
└───────────────────────────────────────────────────────┘

Steps to reproduce:
* Open Odoo on Mobile
* Go to a Kanban view with list height at least twice the screen height
* Scroll to the end of the page (the control panel is hidden)
* Scroll a bit upper => BUG the control panel is not visible until we
scroll in the 'box' of the '.o_action_manager'

Note this behaviour is maybe related to an issue from CSS3 [2]
from MDN [3]

Ref:
[1] odoo/odoo@3fea5b2136
[2] Issue 865 on https://github.com/w3c/csswg-drafts
[3] https://developer.mozilla.org/en-US/docs/Web/CSS/position

closes odoo/odoo#77660

X-original-commit: fdcfaa7b72a4af0d0c3e308e299638fc8fa19bdb
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
2021-10-02 10:20:18 +00:00
Sébastien Theys 872227e076 [FIX] mail: prevent session expired with channel_info for guest
closes odoo/odoo#77561

X-original-commit: e1c68fa4e3dbbdedce45a86f404ded2350c7b46c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-30 18:28:00 +00:00
Sébastien Theys e2b99a9d68 [FIX] mail: use nameOrDisplayName in reactions
If the name is not known, fallback to the displayName.

closes odoo/odoo#77553

X-original-commit: 50f3581df712d5f2cbb6481f7fcb8c164ebb2da2
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-30 17:12:22 +00:00
Sébastien Theys 2b1d8324f4 [IMP] mail: reduce voiceActivationThreshold
The current threshold seems to high for most people. It is preferable to catch
too much sound and then request people to increase the threshold, than catch too
little and have frustrating experience of not hearing people talking at all.

X-original-commit: 59aa5b3c209bc6717cd95266c62fc8b1abb68475
Part-of: odoo/odoo#77553
2021-09-30 17:12:21 +00:00
Louis Wicket (wil) 985b7f37d7 [IMP] mail: merge welcome and thread views
This commit will merge welcome and thread views in the same route and
template. The aim is to make the user interacting with the page (by
landing them on the welcome view first) so that the browser allows the
page to play audio and to switch to full screen.

closes odoo/odoo#77381

X-original-commit: 97ed683e3e7cc6b340bb78c4faa01a703a573f32
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-30 17:11:46 +00:00
Julien Banken 93425828fc [IMP] mail,sms: remove create button from SMS and Mail failure view
When the user opens the notification panel from the navbar and click on
a notification indicating that an error occurs while sending an sms
or an email, the user will be redirected to a new view listing the users
that did not received the sms or the email. As it makes no sens to create
a partner from that view, we will remove the "CREATE" button.

task-2523036

Part-of: odoo/odoo#71413
2021-09-30 13:31:53 +00:00
Samuel Degueldre 029ecd3363 [FIX] mail: fix various crashes in webRTC, improve logging
closes odoo/odoo#77430

X-original-commit: ef378ef31833e4feb5e3763b9d28757e488d45cb
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-30 07:51:02 +00:00
Samuel Degueldre 6e36705a33 [FIX] mail: fix warning about invalid width/height in rtc layout
closes odoo/odoo#77432

X-original-commit: 2b5c97b9ada063a67810c97af05dd483c4be9cd2
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-29 23:57:17 +00:00
Sébastien Theys bb01546164 [IMP] mail: use exclamation instead of signal on rtc issue
closes odoo/odoo#77431

X-original-commit: e806a1fb173af7cf74953c94a9430b1a1398f87d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-29 23:57:07 +00:00
Sébastien Theys bdbcf51bf4 [IMP] mail: add ping for active RTC session and clean obsolete
closes odoo/odoo#77382

X-original-commit: 263e77e5d252b61e1dd838c7559e957a20fa2b18
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-29 01:10:51 +00:00
Samuel Degueldre ecf5fbb4a8 [FIX] mail: fix "cannot read 'id' of undefined" in RTC calls
closes odoo/odoo#77371

X-original-commit: e2a2d9f17d7bf3b48ca45c5000547bb82dde3225
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:36 +00:00
Samuel Degueldre 567a09f58a [FIX] mail: fix crashes in methods on PeerConnection in invalid state
closes odoo/odoo#77370

X-original-commit: 5caa7f1aa094813c9f450ad839f1511045e33cca
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:32 +00:00
Samuel Degueldre 347756909a [FIX] mail: fix crash when trying to catch result of play()
Some browsers don't return a promise from mediaElement.play(), we wrap
it in promise.resolve to solve the issue.

closes odoo/odoo#77368

X-original-commit: 50898870067d05fb01722487dc2d63a1a5155c7d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:23 +00:00
Samuel Degueldre 5ae5c81a23 [FIX] mail: fix settings crashes
In odoo/odoo#76941 some getters were removed but the code using those
getters was not entirely adapted, causing crashes.

This commit also fixes an unrelated crash, where we were attempting to
save the push-to-talk settings for guests, which cannot work as they do
not have a correspoding user.

closes odoo/odoo#77343

X-original-commit: 99a5a59c610ee4d421f5671aa6680377df08168a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 17:45:17 +00:00
Samuel Degueldre e648513376 [FIX] mail: stop showing "Add a description" to guests
closes odoo/odoo#77341

X-original-commit: 38b5e110469b6a3a49e39df3ac0c7b73795aae1f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 17:45:13 +00:00
Samuel Degueldre 3d3f6e6b15 [FIX] mail: fix guest getting session expired warning on mention
When attempting to mention a user or a channel, an RPC is performed.
This uses a method on a model, which guests cannot perform as they don't
have a valid session cookie. This commit deactivates the mention
functionality for guests.

X-original-commit: fe6f2b660a84cfdb74834d52d6ff7860776a2e70
Part-of: odoo/odoo#77341
2021-09-28 17:45:13 +00:00
Nikunj Ladava 025c022c03 [FIX] mail: support html message notification
Notification service is supporting html message in it, but in simple
notification it is not triggering the html notifications. So here we add
html message support in simple notification to show the html content in it
when requested.

Before this commit: it was showinng simple text of html

After this commit: it will show the html content in notification

Task-2269743

Part-of: odoo/odoo#60605
2021-09-28 16:27:16 +00:00
Lucas Perais (lpe) 56a35fc294 [FIX] mail: hooks: correctly remove handler
Element.removeEventListener takes the same instance of the handler function
added with addEventListener. Giving it another function (either via a bind or an arrow)
wouldn't have any effect, leaving the handler actually in place.

This commit corrects some code in that direction.

X-original-commit: 82d710ee24ee01dad8fcf6a460fc064a498b5b02
Part-of: odoo/odoo#77285
2021-09-28 06:48:40 +00:00