Before this PR, suggested recipients without partner where not
checked and needed to be manually created. This is prone to mistakes
when sending an email to the suggested recipient.
This PR checks all the suggested recipients by default and create
the missing partners when a message is posted, and when full composer
is open. That way, there's far less risk to not send the email to
suggested recipient, and instead the user should manually uncheck
to not send the email.
closesodoo/odoo#128647
X-original-commit: 258b2420676fb1a0d7e834ab79f6bf1ec0f73254
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
With the discuss refactoring, two memory leaks were introduced:
- the activity service opens a broadcast channel for cross-tab
communication. Because services have no destruction mechanism, the
broadcast channel is never closed, and since most tests create their own
test environment with services, each test would leak an instance of the
activity service as it is captured by the bound onmessage function. The
activity service holds a reference to the mail store which results in a
large leak
- the RelativeTime component creates a timeout so that it can update its
time every minute or every hour depending on how old the message is,
this timeout is cleared when the component is destroyed. This component
tries to initialize the value of its timeout to `null`, but it does so
*after* calling the method that actually sets the timeout, causing the
timeout to be overriden with null and never cleared
The BroadcastChannel problem has been solved by adding BroadcastChannel
to the browser object, and patching it in the test setup code of web, as
it's a generic problem with BroadcastChannels. The timeout problem has
been fixed by simply reordering the lines so that we don't override the
timeout and it gets correctly cleared when the component is destroyed.
closesodoo/odoo#128768
X-original-commit: bd25f14d7a746fe48e09edea7ebb4aaa4634fbdc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when an item in discuss app is active or
mouse-hovered in dark mode, there was no indicator.
This is caused by `bg-200` being equivalent to `bg-view` in
dark mode, therefore the active items were not visually distinct
from the background.
This commit fixes the issue by keeping `bg-200` in white mode, but
this becomes `bg-100` in dark mode. That way, active items are
slightly highlighted as they should
closesodoo/odoo#128767
X-original-commit: d66db4aa257984ae984d3207819c2a23b0f6897c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The method 'add_member' has 'partner_ids' as a optional parameter , but
the thing is the test 'test_attachment_hijack' is only passing it as a
single ID off res.partner record. Let's say if somewhere we overide this
method and write something like
self.env['res.users'].search([('partner_id', 'in', partner_ids)]) , it
will fail because 'partner_ids' should be a list.
closesodoo/odoo#128759
X-original-commit: 75cb1266afa8b921f8d0ca153f5d05ad47c9b14c
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Before this commit, the data of all followers of a chatter were
fetched whenever `mail/thread/data` was called. This route is
called when loading the chatter for the first time, and whenever
the chatter must be reloaded.
When there are at most dozens of followers, it's not a big deal.
However, with thousand of followers, the route `mail/thread/data`
may become quite long, which made chatter barely usable with a
long loading.
This commit fixes the issue by showing only 100 followers at once
when opening the follower menu. When scrolling down the list,
it loads data of more followers.
Task-3293718
closesodoo/odoo#127966
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Before this commit, a test of call was using the real web media API
and would request micrphone access to the brower. This commit fixes
this issue by using the mocked version for this test.
closesodoo/odoo#128722
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR there was no way to add a sort criteria to the
partner suggestions. This commit introduce a registry of compare
functions that can be arranged thanks to a sequence key. This way,
it will be very easy to add custom sort criteria.
part of task-3332872
closesodoo/odoo#128570
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When a message is posted, sometimes the label tells the message
is edited when it definitely shouldn't.
This happens because implementation of detecting whether a message
is edited relies on difference between `create_date` and
`write_date`. This implementation is flawed, especially when the
message being newly posted has its fields being updated in another
ransaction, which is unfortunately what happens when the message
should be sent by email.
No good solution to preserve this label in a working state was
found, so the showing of this label is being disabled.
Messages can still be edited: only the label is no longer shown
after this commit. This makes feature of message edition matches how
it was in prior versions of Odoo, where the label was also missing.
closesodoo/odoo#128656
X-original-commit: f5d108eff2276ba577a52d9d10a82f9ea769c701
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, some notifications handler were using `return`.
The issue is that this will exit the notification processing loop
preventing further notifications to be processed. In practice, this
scenario is limited since notifications come by small batches but
it could be an issue.
closesodoo/odoo#128606
X-original-commit: e8fbc26716917b1066b9002010662d41aaeacbf0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: mail, mrp, test_website, web, web_editor
Before this commit '.webp' images could not be used in odoo.
After this commit '.webp' images can be uploaded to odoo.
- can be used in image field
- can be used in HTML field image
- can be used in mails and website
- can be transformed (shape mask, filter effect, crop, rotate, resize,
adjust quality)
task-2774352
Part-of: odoo/odoo#85494
The "add-user" thread action is not necessarily present in the view,
therefore the action should not necessarily be programmatically
called.
This commit fixes the issue by letting discuss app programmatically
call the invitation button precisely in the next rendering when
it was requested from click on "start a meeting".
Fixes runbot-23240
closesodoo/odoo#128510
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
A serialization error can happen when chatting with another
user from the company. To reproduce:
- Log into Odoo as User A
- Open another Odoo tab in the same window as User A
- In private mode log into Odoo as User B
- Send a message via chat from User B to User A.
A concurrent update happens in channel_fetched method when writing
on mail_channel_partner.fetched_message_id.
To fix that, update the field
through raw SQL using FOR NO KEY UPDATE SKIP LOCKED in select subquery.
This skips the row should it be already locked, which is fine
as we only need to first transaction in the queue to complete.
opw-3164584
closesodoo/odoo#128464
X-original-commit: 5e95bfc2a9e68ea7643ea436968dcad19fdeeff9
Signed-off-by: Aurélien van Delft (avd) <avd@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Before this commit, opening full composer from chatter were always
copying the selected suggested recipients, regardless of the mode
of the composer.
Suggested recipients only makes sense in "Send message" mode,
therefore it should not copy them in "Log note" mode, which this
commit fixes.
Also fix a bug where copying of suggested recipients in full composer
was taking all suggested recipients into account, regardless of
checkbox state. This commit fixes issue by copying only checked
suggested recipients
closesodoo/odoo#128466
X-original-commit: 89afc58a69a53824a9100ceaf4f3574bb82dfc1d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit
When the user clicks on "Start a meeting" button, the invitation popup does not
open.
After this commit
The invitation popup now opens when the user clicks the "Start a meeting"
button.
Task-3346081
closesodoo/odoo#128320
X-original-commit: 12f2ddf722d659df651e5ef929f775ea1cabed88
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, the lang of the visitor was only shown on the
member list based on the `anonymous_country` of the channel.
In order for this information to be as complete as possible, the
lang is now also checked on the website visitor if there is one.
part of task-3332872
closesodoo/odoo#128242
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
luxon and moment are both used in the solution, but
these two libraries facilitate the manipulation of dates.
It was decided to replace all uses of moment with
luxon so we can then remove moment.js from the
code and lighten the assets.
task-3391739
closesodoo/odoo#127406
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Opening DM chat or making group chat is determined by amount of
members in the resulting conversation to start. Before this commit,
starting a conversation with self and another user was wrongly
considered as making a group chat, because it wrongly assumed there'd
be 3 channel members in this conversation: the other user,
self (explicitly), and self again (implicitly).
This commit makes DM or group chat more natural when dealing with
self user:
- Adding only self to start a conversation should open a self-chat
- Adding a user to self-chat should open DM chat
- Invite more than one user in self-chat should make a group chat
task-3382231
closesodoo/odoo#126361
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, link preview showed the whole text content
of the link preview, which has it's limit at around 300 characters.
When description is long, the link preview was too long, which made
it too visible as a "preview".
This commit fixes the issue by truncating the description to at most
2 lines.
Task-3416429
closesodoo/odoo#128347
X-original-commit: 73025d977f6960a829f914a3f0f0c0d87abbb561
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Steps to reproduce:
- Install CRM and Helpdesk modules (for test purposes)
- Set a custom alias domain (e.g. "mydomain.com")
- Go to CRM > Configuration > Sales Teams
- Check that a team has en email Alias (e.g. "info@mydomain.com")
- Go to Helpdesk > Configuration > Helpdesk Teams
- Check that a team has en email Alias (e.g. "support@mydomain.com")
- Email your instance with the following `to` value:
info@mydomain.com, support@test.com
(notice second email does not match the DB alias domain)
- Go to CRM : A task has been created
- Go to Helpdesk : A ticket has been created
Issue:
The ticket in Helpdesk should not have been created.
Cause:
The message_route method does not check the domain of the email
address before creating the routes.
Solution:
If `mail.catchall.domain.allowed` system parameter is set, filter to
only keep the emails address that match the allowed domains (including
domain set in `mail.catchall.domain` system parameter).
The value of `mail.catchall.domain.allowed` system parameter should
be a comma separated list of domains. e.g. `example.com,example.org`
opw-3150972
closesodoo/odoo#128346
X-original-commit: 5b73428104789433fd65431f7631a2e9eb863b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The Odoo mobile app manages push notifications by the app
itself, not the web app. Therefore there's no need to enable
web push notifications.
This commit fixes the issue by considering web push notification
being denied in the mobile app.
closesodoo/odoo#128344
X-original-commit: 045aeaace279d585a7ebefcd5cba7d32207ba9ba
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when posting a message in chat window of chatter,
it was posting it in "Send message" mode. This mode notifies all
followers of the chatter.
Even though this is the default mode of chatter, there's no explicit
way to define the composer mode in chat window of chatter. Usually
chatter in chat window is used for internal communication, where
logging notes and pinging users with `@`-mentions is mostly used.
Since the chat window was in "Send message", it could inadvertly
notify users of message content not addressed to them. Logging note
is much safer, as it notifies users only when explicitly mentionned
in the message content.
This commit fixes the issue by putting composer mode of chatter
in chat window in "Log note", so that there's no longer a risk to
send message to wrong recipients by mistake.
Also put proper placeholder in chatter of chat window and reply-to
in discuss app, so it's clear posting message will either send
message or log a note.
closesodoo/odoo#128337
X-original-commit: e2609b2f8134b7c3248fb2d519daaadabf5401bf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR suggested recipients were not correctly moved to the full
composer because the partner id is stored on the persona.
closesodoo/odoo#128291
X-original-commit: 38902e19389d2d559bf5866bfa96f638ca619c34
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Livechat override of `_message_update_content` accesses `self` channel
but it was not called with the guest env, leading to access error.
Part-of: odoo/odoo#128290
The attachment list was not displaying extra attachments that were
received from the bus if the list had at least one attachment.
Part-of: odoo/odoo#128290
`discuss_public_tour` is ran after `discuss_channel_as_guest_tour`
leading to all steps presents in both to be executed twice.
The opportunity is taken to add empty `run` functions to avoid
unnecessary clicks.
Part-of: odoo/odoo#128290
Before this commit, action list of message was centered with
message. This can be hard to notice where the actions are shown
on long messages.
This commit fixes the issue by positioning action lists always
next to the 1st line of message content.
closesodoo/odoo#128274
X-original-commit: 7227513eac8242f9f94d75eed6b84ef99098cff2
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, inviting a partner to a livechat channel
had no effect. This commit solves this issue.
Steps to reproduce:
- Go to a livechat channel in the discuss app
- Click on invite a member on the top right corner
- Select a member
- Click on the invite button
- Nothing happens
closesodoo/odoo#128173
X-original-commit: 94086d9289222008f59a97611a80de4e1310e41c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
`get_link_preview_from_html` was coded to avoid fetching the entire page content when it only needs page data, however it tries to decode the entire input buffer even though the fetch window might cut off a codepoint in two.
Fix by stripping out anything which follows the `</head>` tag, which might contain partial codepoints.
Also add a few more improvements:
- avoid visiting the entire buffer if we parsed more than 16k (as unlikely as that is), even when offsetted `find` returns an offset from the start of the buffer
- don't decode upfront, as `html.fromstring` will decode just fine internally (better really as it has decoding fallbacks)
closesodoo/odoo#128240
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
From commit 2ecfed335d, clicking on the arrow of a m2o opens the
record in form view and passes it the context of the current view.
After this commit, only the context defined on the <field> is passed.
Problem:
An example of a problem, is the use of an incorrect active_id in the
second view that is passed through the first form view to the second.
Previously, the active_id of a form view was always the id of the record
and not that of the previous view. This behaviour is debatable, but it
leads to major changes. We therefore prefer to revert to the old behaviour
and no longer pass the entire context in order to avoid this problem.
How to reproduce:
- Go to a form view with a m2o
- Click on the arrow of the m2o
Before this commit:
The view context contains all the context from the first form
view and the second.
After this commit:
The view context contains the context of the m2o field and the second view.
closesodoo/odoo#127538
Taskid: 3394945
X-original-commit: a9bec1fec3ff08461732ef2717457524339eb716
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Prior to this commit, there was a spacing issue between `mobileTopbar`
buttons.
This PR fixes this issue.
task-3415575
Part of task-3326263
closesodoo/odoo#128190
X-original-commit: c599df12fe99bbf6ca5eaef2abc4ac94d27a59ae
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, a crash occurred when an unknown member
left a channel.
Steps to reproduce:
- Open two browsers, one for admin, one for demo
- Ensures both users are on the general channel
- Execute the `/leave` command with demo
- A traceback appears on the admin browser
This issue occurs because the `action_unfollow` only sends
the channel member id through the bus but the client relies
on other keys without checking for their presence. This
commit fixes this issue.
closesodoo/odoo#128090
X-original-commit: f8452b2eb8f9243402984d78184ed494384a187c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Before this commit, the suggestion list would not work when
a string with no match was entered then modified.
Steps to reproduce:
- Open a channel
- Type `/hee` (this string matches no suggestion)
- Delete one of the `e` in order to get `/he`
- This string should match the `/help` suggestion but nothing
is shown.
There is several issues here:
- The suggestion hook is based on the composer selection but
the `selectionChange` event is not triggered when deleting text
from the textarea which leads to incorrect selection.
- The search is cleared in the `suggestionHook` when nothing is
found which leads to incorrect delimiter position after a deletion.
This commit fixes both issues.
closesodoo/odoo#127997
X-original-commit: b8bf65478cad558e02a5902886b3e4272483944e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Specify explicit route for each ,, line
This is part of task 3230280 where global ir.model.access will be
forbidden.
The goal is to make access to public/portal explicit. Too often,
global access was granted with only employees in mind.
Remove ,,0,0,0,0 lines
mail:
employee already had read access to mail.group
still needed to subtypes as in ir.rule domain
mail_group: employee already had read access
pos_mercury: only needed for employees
membership:
move public access for website_membership as needed in the controllers
website_customer: employee already had read access
website_event_booth: no need for category
website_event_exhibitor: retrieved in sudo
website_event_track: not needed for location
Part-of: odoo/odoo#125216
Before this commit, transient messages were inserted at the
wrong position.
Steps to reproduce:
- Send a message on a channel
- Execute the `/help` command
- The transient message is positioned before the message
that was sent first.
When a message was posted, the message fetch route was called
and the transient messages were inserted again.
They are two issues here:
- Messages should not be fetched when posting a message
- Transient message index is wrongly computed when it is
the last one.
This PR fixes both issues.
closesodoo/odoo#127979
X-original-commit: bebea00e1ff0757ce5ce34d6ae87f6adef2e515c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This commit fixes the style of the close chatter button in the
attachment view to match new Milk button design
It also fixes a no spacing issue between `.o-mail-Chatter-close` and
`.o-mail-Chatter-follow`
task-3415853
part of task-3326263
closesodoo/odoo#127978
X-original-commit: f655bdfda5caf6608d4364f49bdddf25f3abf201
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
PURPOSE
Settings allow to change colors used in emails (primary and secondary colors).
Those are used for headers and buttons. They are currently shared with colors
used for base documents and reports layout: changing email colors change
documents colors, which is not expected nor clearly indicated.
SPECIFICATIONS
Split configuration: colors used in documents may differ from colors used in
emails. Duplicate color fields (primary and secondary). To ease setup when
updating documents colors, update mail colors accordingly. Inverse is not
true as we consider documents being the main configuration, and emails a
more fine-grain configuration.
Task-3346388
Part-of: odoo/odoo#123678