Commit Graph
8805 Commits
Author SHA1 Message Date
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
root 50f6e5f2be [IMP] mail: quick-open related record from message
Before this commit if you found a message and wanted to open the related record you would need to find it manually by finding the right view and then using the ID stored on the message to open it.
By adding a smartbutton the user can quick-navigate to the related record in a second.
This allows for quickly finding and opening records which is usually handy when debugging things.
Ref Task-2660873

closes odoo/odoo#77675

closes odoo/odoo#77803

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 12:36:00 +00:00
Hubert Van de Walle (huvw) 7ea4eeae86 [FIX] mail: exception when sending an email with \n in the record_name
Step to follow:

  - Create an Asset Models
  - Set up the Fixed Asset Account:

  Automate Asset -> Create in draft or Create and validate
  Asset Model -> The one you have just created

  - Create a Vendor bill

  Account -> the Fixed Asset Account of the asset model created
  Label -> insert a newline
  Price -> (do not forget to set a price)

  - Validate
  - Go to the asset automatically created
  - @ mention a user in the chatter

Cause of the issue:

  The generated email subject comes from the record_name and it can
  contain newlines
  Email headers don't allow newlines and an exception is thrown here
  https://github.com/python/cpython/blob/60b93d9e4922eeae25052bc15909d1f4152babde/Lib/email/policy.py#L143

Solution

  Replace newlines by spaces in the email subject

opw-2522055

closes odoo/odoo#77712

X-original-commit: ed343998d39ff91a3f73cc8012be498d32c91b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-04 14:12:30 +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
Louis Wicket (wil) 640fa1d1c3 [FIX] mail: ensure guest is in the context
Update a specific flow to ensure the record on which session_info is
called has guest in its context. This is needed because session_info
performs some checks on guest to determine if it should add translations
data.

closes odoo/odoo#77433

X-original-commit: bd0940cdbf43131ed8436a5deb3f8afebfbc37ab
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-01 10:09:42 +00:00
Didier (did) db4e07e52e [FIX] mail: exclude portal user from the DM search
Before this commit, a user could DM a portal user.
Portal user are not supported and can't chat.

task-2632874

closes odoo/odoo#77568

X-original-commit: a7eda6d7314e7261ddda32620fae817f1d828bae
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-30 19:42:15 +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
Julien Banken e4c583fcc8 [IMP] mail,sms: revamp the resend modals
The error messages of the resend modals can be partially hidden in the
table. The user can therefore have difficulty to understand what went
wrong when the server failed to send an email or an sms. To avoid that,
we will ensure that the error messages will be fully visible in the table.

To improve the interface, we will also update the label of a some fields
and we will automatically hide the 'Send & Close' buttons from the resend
modals when the user did not select at least one recipient from the list.

task-2523036

Part-of: odoo/odoo#71413
2021-09-30 13:31:53 +00:00
Julien Banken 259508fdd4 [IMP] mail: improve the settings page of the mail template
The settings page of the mail template has too specific placeholders. To
improve the genericity and the consistency of the placeholders, we will
use placeholders about the same topic.

task-2523036

Part-of: odoo/odoo#71413
2021-09-30 13:31:52 +00:00
Julien Banken fbb9a25367 [IMP] mail: revamp the mail composer
On the CRM module, the user can send an email to all the contacts
associated to the leads matching some criteria by (1) displaying the
list view, (2) applying a search filter, (3) clicking on the "EMAIL"
button and (4) checking a checkbox on the mail composer to ask the
server to use the active search. To do the same thing, the user can
(1) display the list view, (2) apply a search filter, (3) select all
the records and (3) click on the "EMAIL" button.

To avoid redundancy and improve the usability of the composer, we will
remove the search domain passing from the mail composer. Note that it
will still be possible to pass a search domain programmatically.

To improve the guidance of the mail composer, we will add helper
messages, update the labels and move the options in a dedicated pane.
The wording of the buttons will also be updated dynamically based on
the selected options.

Example: When the user enters something in the `mass_mailing_name` field
to create a new mass mailing campaign from the new message, the label of
the "Send" button will be set to "Send Mass Mailing" which gives more
indication on what will happen when the user clicks on it.

task-2523036

Part-of: odoo/odoo#71413
2021-09-30 13:31:52 +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
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +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
Thibault Francois 7b1eb7a1c6 [FIX] mail: make possible to search on channel_partner_id
Issue
-----
Adding ('channel_partner_id', 'ilike', name) when searching for
mail.channel.rtc.session does not filter out any record

because the model mail.channel.partner does not define any _rec_name
only the name_get

Solution
-------
Implement a _name_search method consistent with the name_get

closes odoo/odoo#77369

X-original-commit: 6c731a75295bbc8107d08ac3ed5c3d01245c782d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-28 21:02:27 +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
Alexandre Kühn 017f738c5d [FIX] mail: Cannot read property "rtc" of undefined
Also resulted in crash `Cannot read property 'sel' of undefined`.

This commit adds some guards in some component templates
that access model records and their fields, to avoid crashes.

These guards are necessary due to the asynchronous rendering of OWL,
which makes it vulnerable to risky changes in models such as
record deletion or any modifcation in any relational fields.

Introduced with https://github.com/odoo/odoo/commit/9bf4b6c29207b97368f27098df3cfbe79e2b5f0f

closes odoo/odoo#77258

X-original-commit: 1dbf02ea72aa0599991f05ff2d9d4f4517055eca
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-09-27 16:57:14 +00:00
Didier (did) 7ebde25cf7 [FIX] mail: avoid exception when creating channel
When a user without an email partner try to create a channel, an exception is
raised because he has no email.
This exception should not happen when creating a new channel.

task-2641660

closes odoo/odoo#77147

X-original-commit: 0970d8767ac27f9542bb3ad40a6f213f80f408d8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-24 14:00:30 +00:00
Louis Wicket (wil) d72b8f2a17 [FIX] mail: correct inaccurate doc comment
This commit will correct an inaccurate comment introduced with
odoo/odoo#76951. The comment states that the 'joinButton' shall be
disabled when the current user is NOT a guest, which is not true:
'joinButton' can only be disabled if the current user is a guest.

closes odoo/odoo#77149

X-original-commit: 93a78e437e9c7775f4b174f660e22368bdd4a3aa
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-24 12:35:24 +00:00
Alexandre Kühn cb69d7a93e [FIX] mail: enforce boolean value on computed fields of webRTC
closes odoo/odoo#77107

X-original-commit: ad9d6fd0f14a4d954940cf4cd5f4a2bcf91b81b5
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-09-23 20:18:43 +00:00
Alexandre Kühn 57bf42603c [FIX] mail: no crash on save volume settings by guests
X-original-commit: a91322154b607e40b4a007e743e9d9975aa1f256
Part-of: odoo/odoo#77107
2021-09-23 20:18:42 +00:00
Alexandre Kühn 527c4202d6 [FIX] mail: make keyframes naming more appropriately specific
X-original-commit: 07ec5766dd33fae2a128fa62e3ac5e6aec8ea4bc
Part-of: odoo/odoo#77107
2021-09-23 20:18:42 +00:00
Alexandre Kühn b6d9bea33a [FIX] mail: fix typos (likely to fix webRTC recovery every 30sec in case of failure)
X-original-commit: 60eccab558d7a40cb4a27c7042f62f547e581ee6
Part-of: odoo/odoo#77107
2021-09-23 20:18:42 +00:00
Alexandre Kühn 07053cbfaa [IMP] mail: rename "mailRtc" fields to "rtc"
X-original-commit: 8db877c99f3b3c405e7a51920a574edfeb7a18d5
Part-of: odoo/odoo#77107
2021-09-23 20:18:42 +00:00
Alexandre Kühn d5d93bdf05 [FIX] mail: remove webRTC component excessive getters
X-original-commit: 9bf4b6c29207b97368f27098df3cfbe79e2b5f0f
Part-of: odoo/odoo#77107
2021-09-23 20:18:41 +00:00
Alexandre Kühn 099bde0b75 [FIX] mail: make webRTC component classname follow BEM convention
X-original-commit: c8296c4ed6c3f0c95852bc5b3466f6fea34368a3
Part-of: odoo/odoo#77107
2021-09-23 20:18:41 +00:00
David Tran f167d47b48 [FIX] mail: remove emojis 3:
There was 3 keys for the same icon 😠 while one of them is usually used
in normal text. For example:

- Item 1:
- Item 2:
- Item 3:

The last one would convert to `- Item 😠`

This PR removes one of the above to keep the other two

closes odoo/odoo#77075

X-original-commit: 45e9636c2e0457d3bc4ea1d346ff71ed6824bbe1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-23 17:27:53 +00:00
Louis Wicket (wil) 4e45ce9d06 [IMP] mail: automatically ask for media access when relevant
Ask for camera/microphone access when landing on the WelcomeView of a
channel created via the "Start a meeting" feature.

Part of task 2651831.

closes odoo/odoo#77011

X-original-commit: ef92577ae2ef602c279b47c5c0b1235334d5984c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-23 10:00:16 +00:00
Samuel Degueldre 9efd9463eb [IMP] mail: allow creating channels on first visit from token
This commit allows anyone to create a new mail.channel by visiting the
URL /chat/<token>[/<channel_name>], providing that the
mail.chat_from_token system parameter is set. This is useful in some
situations where new channels need to be created quickly as needed by
anyone without special permissions (eg, during the Odoo experience)

task-2648580

closes odoo/odoo#77010

X-original-commit: 56ddc073213a148579dd72f4a9336bc4d6a11f22
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-09-23 10:00:11 +00:00
Didier (did) 2750c09548 [FIX] mail: show group chat in messaging menu
part of task-2634175

closes odoo/odoo#77014

X-original-commit: f37de5ce6fb0e9e7adf50b409c7a5416467396fd
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Phenix <phenix-factory@users.noreply.github.com>
2021-09-23 07:17:56 +00:00
Habib (ayh) 45ee18ce5b [IMP] mail: enable inheritance in the next activity values computation
values for next activities are currently prepared inside the `mail_activity._action_done()` method which makes inheritance very difficult. This commit delegates the value computation to a sub-method and thereby improves the extensibility of the module.

required to support changes to enterprise documents odoo/enterprise#20769
Task-2627837

closes odoo/odoo#77004

X-original-commit: a26e6e954c5e6c773f37e9239138a7b94ded821f
Related: odoo/enterprise#21079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-22 20:38:59 +00:00
Raf VenandThibault Delavallee be8aa967f0 [IMP] base: merge activities of merged partners
When merging partners through the ``base.partner.merge.automatic.wizard``
wizard, messages and followers are merged. However activities are not
probably because its underlying model is "newer" then messages and followers.

This commits fixes that behavior.

Task-2641572
PR odoo#76159
Closes #71654

X-original-commit: 7e17678ec6ebbbe37b807a5d264cc5afd46bae1a
Part-of: odoo/odoo#77005
Co-authored-by: Thibault Delavallee <tde@odoo.com>
2021-09-22 19:25:56 +00:00
Jairo LlopisandThibault Delavallee 1efeffd297 [FW][IMP] test_mail: test models with type do not mess with attachment types
Purpose of this commit is to highlight an issue that may happens easily with
`crm` that is made generic here within `test_mail`.

`crm` alters the context when creating a new record adding in this case
`default_type` to it][1]. The returned record contains that altered context.
his results in other records created from it trying to assign that same default
value for `type`. This is a very common name for fields, and happens to exist
in `ir.attachment` too.

If you create an alias for incoming leads in your DB with default values
`{"type": "lead"}` (something very common) and then an email comes to that
alias that contains an inlined base64 image, the attachment creation process
would simply fail.

Obtained error is ``ValueError: Wrong value for ir.attachment.type: 'lead'`` .

[1]: https://github.com/odoo/odoo/blob/272602193f5647f7f2270ed6ec68777625a139dd/addons/crm/models/crm_lead.py#L310-L311

X-original-commit: 99434b2e8528c10fcc9cb6860765e0ddcaa364c8
Part-of: odoo/odoo#77005
Co-authored-by: Thibault Delavallee <tde@odoo.com>
2021-09-22 19:25:55 +00:00
Jinal PatelandThibault Delavallee 223b51c462 [FIX] mail: fix ACLs issue with mail composer in new mode
As create_uid has no value on mail.compose.message model when being in onchange
or new mode, 'Mail Compose Message Rule' record rule may crash. In this
commit we fix that issue by adding a value for create_uid. An unit test is
added to ensure it effectively fixes the use case.

Steps to reproduce this warning:
 1. Create automated action for the 'mail.compose.message' model
 2. Try to open 'Email compose Wizard'

Warning:

"Due to security restrictions, you are not allowed to modify 'Email composition
wizard' (mail.compose.message) records.

Records: mail.compose.message,NewId_0x7f8e99762310 (id=NewId_0x7f8e99762310)
User: USERNAME (id=2)

This restriction is due to the following rules:

Contact your administrator to request access if necessary."

Task-2641572
opw-2628005
PR odoo#76159
Closes#75369

X-original-commit: 26d64c0b84b76bb9164a8895bcc21b66754478ae
Part-of: odoo/odoo#77005
Co-authored-by: Thibault Delavallee <tde@odoo.com>
2021-09-22 19:25:55 +00:00
Florent de LabarreandThibault Delavallee a8518ae75d [FIX] mail: handle parsing of void body in incoming emails
When body does not contain any tag or content parsing currently fails
with an ``lxml.etree.ParserError``. To avoid that we can improve condition
about void body: stripping void characters allows to avoid that traceback.

Task-2641572
PR odoo#76159
Closes odoo#75625

X-original-commit: 708fe3e74991c144a05c6bdcafa1931672e36ce9
Part-of: odoo/odoo#77005
Co-authored-by: Thibault Delavallee <tde@odoo.com>
2021-09-22 19:25:54 +00:00