Before this commit, there could be race conditions in which a channel
could be removed while the call was still loading, this commit prevents
this issue.
task-3660964
closesodoo/odoo#149034
Signed-off-by: Thanh Son Dodeur (tso) <tso@odoo.com>
Steps to reproduce:
- Go to activity view.
- Schedule an activity for one record. (Say 8 records are available)
- Schedule an activity for the second time. (Again 8 records are available)
- Try to schedule an activity for the 3rd time. (Only 2 records are available)
Issue:
Since 7682286, the existing props of activity model are being passed as params
while scheduling an activity. Currently, `["activity_ids", "!=", false]` is
being pushed to the domain of activity model in order to display only those
records on which activities have been set. As a result, after you schedule
activities more than once, `["activity_ids", "!=", false]` domain gets applied
and the list of records available for scheduling activity is restricted from
the third time onwards.
Fix:
This commit passes the props from searchModel as params to the 'load' method
while scheduling activity, instead of existing props, to ensure that the
existing params are applied as well as all records are accessible for
scheduling an activity, in `searchCreateDialog`
(i.e.["activity_ids", "!=", false] condition is not added as domain).
Task : 3721750
closesodoo/odoo#155700
X-original-commit: 339df084567206cff8a5487bbe9dec249671244a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Khushi Patel (khpa) <khpa@odoo.com>
Before this PR, the `bus subscription is refreshed when channel is
left` test was sometimes failing. This actually reveals a real issue:
if a channel is joined a leave very quickly, the bus subscription is
not updated.
This occurs because we rely on the last subscription made and the one
that should be made to detect if channels differ. Since the
`updateBusSubscription` method is debounced, we can miss information.
This PR replaces the complicated `updateBusSubscription` method by a
`onAdd/onDelete`. This is much more reliable and more efficient since
there is no need to walk through every channel to detect changes.
This PR also remove a test that was redundant that the failing one.
fixes runbot-55292,57645,56232
closesodoo/odoo#155720
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
1. channel mention should work for channels, chats, and groups, even if
there is a group restriction for the channel.
2. channel mention in livechat is disabled because the visitor can't get
access to the channel.
3. remove the fetch and search for channel mentions in livechat so that
there is no extra rpc call for unuseful data.
4. add a test for the channel mention in thread.
closesodoo/odoo#155380
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit:
Squashed transient messages had date displayed in the sidebar of the message.
This was introduced by this commit: 631ae1c
After this commit:
Squashed transient messages would not have date in the message sidebar.
closesodoo/odoo#154594
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This value is accessed often during sort of messaging menu, so it's
better to not compute it each time on the fly.
- make it a compute
- access correspondent2 to avoid extra indirection
- store in variable in sort instead of accessing twice (less proxy get)
The performance impact is more visible for subsequent sorting, as the
first one benefits less from the cache (when it still has to be built).
Part-of: odoo/odoo#155068
Avoid doing this process every time the datetime is accessed.
It looks like it is already cached with `_datetime`, but it's not
efficient because there are still many proxy get access (which are
costly).
3 proxy access before: getter itself, reading _datetime twice
1 proxy access after: the field itself
Part-of: odoo/odoo#155068
*: mail.
This PR removes the live chat sidebar category. From now on, each
channel will have its own category. This is a first step towards
providing an efficient way for operators to join/leave a live chat
channel.
part of task-3640730
closesodoo/odoo#154755
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Move compute of `imStatusTrackedPersonas` to its inverse field. Doing
the compute on the "One" side of the relation prevents from looping and
computing all values whenever there is a change in any of them.
In practice, this reduces the "compute" time of the message fetch (which
also fetch persona as authors of messages), reducing by approximately
half the time it takes to insert these messages (depending on the number
of persona it had to loop through).
For example from 60ms to 30ms on my machine for message insert in
"partner_1_125" (populate medium).
closesodoo/odoo#154918
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, if the search result would have "load more", the
extra messages would immediately be fetched, defeating the purpose to
have load more in the first place, and making unnecessary requests.
closesodoo/odoo#154406
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Since 16.3, opening the web client on the Odoo backends results in two
subscribe events being sent through the bus websocket.
Discuss listens to the thread changes to know when the subscription
should be refreshed. In order to do so, the last subscription that was
made is kept. This issue is that this subscription is empty in the
first place so the first evaluation always considers the subscription
should be made.
In order to fix this issue, this PR refine the condition to determine
if the subscription should be renewed:
- The last subscription is different from the last one
- The user joined a channel after the bus initialization
- The user left a channel after the bus initialization
In order to test those scenario in a reliable way, this PR also
backports odoo#147455
closesodoo/odoo#154170
X-original-commit: 109b45f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
1. Make sure to return archived users in partner format.
2. Remove the condition to check for archived users in suggestion code.
The condition made no sense since the refactoring (that's the opposite
of what we want, and it didn't compare the partner records correctly).
The feature is broken since https://github.com/odoo/odoo/pull/133065/
because it "fixed" the way records are compared. Making the condition we
don't want in the first place actually working and excluding OdooBot
(instead of allowing it).
3. Since archived partners are displayed anyway since the refactoring,
and nobody complained, let's consider it a wanted feature.
Archived partners are given lowest priority and moved to the bottom.
task-3747277
closesodoo/odoo#154078
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In commit[1] we changed the spacing of the activity button to dissociate
it from buttons that are "message/communication" oriented.
This spacing was unwanted so we need to revert it back.
task-3730089
[1]: odoo/odoo@e0491c1a62closesodoo/odoo#153100
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The onExternalClick custom hook keeps a reference to elements that may
no longer be in the DOM, this can cause entire sections of the DOM that
are no longer needed to be kept in memory, and can also retain the
associated Owl components and their data.
To solve this, we set the downTarget and upTarget to null after calling
the callback. In practice they are no longer used in the code but we are
keeping it for stable compatibility.
closesodoo/odoo#153654
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This PR fixes 2 issues with discuss navigation:
1. Broken backwards navigation when going back and forth from the live
chat session history.
2. Broken backwards navigation when trying to access the same thread
than the current one.
Steps to reproduce 1:
- Open the command palette
- Go to the live chat session history view
- Click on one of your channels
- History back => leads to the session history view
- History forward => leads to discuss
- History back => stays on discuss, history is broken
This occurs because the active id is not passed in the action context
when navigating backwards which leads to the URL being pushed again in
history (URL without active id is different). The active id should be
put in the context when available.
Steps to reproduce 2:
- Go to discuss
- Click on the active thread
- History back => stuck on discuss, cannot navigate backwards anymore.
We should not push in history when accessing the same thread than the
current one.
task-3422516
closesodoo/odoo#153094
X-original-commit: 029b79ad7dc28aab83289e7c3ebd4cc0dcc5d609
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This commit addresses a problem in CRM where it was not possible to send emails directly from the preview window.
The issue arose when returning to the chatter interface from the preview window,
as the thread object was not properly passed back (to the chatter).
This fix ensures the thread object is reintegrated into the chatter interface, resolving the email sending issue.
Issue was traced back to the commit
5d99de10ec [FIX] mail: do not reload chatter when not needed
https://github.com/odoo/odoo/commit/5d99de10ec09244e10e4130573ad2e0c38e8600
[reproduce]
- install crm
- create activityTypes AT with an email template specified( crm/configuration/activityTypes)
- open a Lead, ( crm/sales/MyPiepline)
- schedule activity with activity type AT
- click "preview" on the activity
- click "send" or just close the preview -> BUG traceback
opw-3680600
closesodoo/odoo#152698
Signed-off-by: Andrzej Pietrusiak (pian) <pian@odoo.com>
Since [1], the websocket worker is started when a transient thread is
added to the mail store. This occurs because this PR introduced a call
to the `addChannel` method of the bus service when the current user
was not member of the thread.
Since transient threads are not yet created, they have a partial state
that does not necessarily include channel members hence the impression
that the current user is not member of the channel.
This PR prevent starting the bus service for transient threads.
[1]: https://github.com/odoo/odoo/pull/146800closesodoo/odoo#153000
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to reproduce:
- Install `crm` module (for test purpose)
- Create a new lead
- Set an email address, phone number, company name and contact name
- Save the lead
- In the chatter, send a mail (with the default recipient checked)
Issue:
- The partner has only the email address set (also set as name).
- The `contact name` on the lead is updated with the partner name
(who is the email address).
Cause:
When sending a mail with the default recipient checked, the partner
is created based only on the email address (therefore, name is same as
email), and when assigning the new partner on the lead, the
`contact name` is updated with the partner name (who is the email
address).
Solution:
Alter the route `/mail/partner/from_email` and `/mail/message/post`
so it can take or manage additional values for the creation of the
partner.
opw-3512045
closesodoo/odoo#152780
X-original-commit: 92916985b72ff1cda2021900f0aa9476f7283576
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Commit [1] moved (almost all of) the code of formatFloat from
views/fields/formatters.js to core/utils/numbers, to make it
accessible in the frontend. A formatFloat function was kept in
formatters.js to handle the false case, which makes no sense in
number utils, but is useful for fields. However, a lot of imports
have been updated to use the numbers.js instead of formatters.js
(i.e. they no longer benefit from the support of false), whereas
they are actually formatting field values, so they should have
kept using the formatFloat from formatters.js
This commit adapts the places where the formatFloat to use must
come from formatters.js, not numbers.js.
[1] https://github.com/odoo/odoo/commit/054ca0a19aaf297f420a1b478b93ae26f1b943b8
task 3722043
closesodoo/odoo#152810
Related: odoo/enterprise#55919
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Steps to reproduce:
Select a document in activity view to get its preview
Click the archive button => traceback
Before this commit:
The 'load' method of Activity Model led to the traceback while attempting
to set the domain of params, when none were received.
(bug introduced by : 7682286)
After this commit:
This issue is resolved by tweaking the code of 'load' method. In case of
default params, it now directly sets a domain, instead of trying to add a
domain to the one obtained in params.
Task ID : 3704340
closesodoo/odoo#152335
X-original-commit: 725ebab1f0c7ffc996414c85fbbd162afc4ecaf5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Khushi Patel (khpa) <khpa@odoo.com>
The opportunity is taken to fix an issue where removing a record from
assign would not update the inverse.
closesodoo/odoo#152442
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
`getLoggedInAsText` is a function, due to missing brackets
the function content was dumped instead of evaluation of function.
opw-3701333
closesodoo/odoo#151600
X-original-commit: 4ce21a4207a9dd7047a6b5ec9c447f9e48ca199c
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when no conversation was selected in the
Discuss app, folding a category such as "Channels" results in
a crash.
This happens because `store.discuss.thread` is `undefined`, so it
must be properly guarded in the template of discuss sidebar category.
closesodoo/odoo#150828
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when a message without bubble layout
is squashed (e.g. with `/who` command twice in a channel),
mouse-hovering on the squashed message pushed increased the
height of the message.
This happens because the sidebar of squashed message contains
the date and it uses 12-hour format with AM/PM.
This design requires cautious use of content in the sidebar,
and had 24-hour format to make it work. A recent refactoring
changed it to 12-hour format as localization was a better concern.
However, the UI is not designed for it, and there's not much value
in having 12-hour format rather than 24-hour format. Indeed,
users assume AM if no AM/PM is shown, except if hour is greater
than 12 which is quite obvious the current time.
12-hour format is best for some users, but we can't have it without
overhauling parts of the UI which is not worth it at the time of
this commit. Therefore using 24-hour format is the better tradeoff.
Also took the opportunity of this PR to better align the date and
seen indicator in squashed message sidebar.
Task-3637270
closesodoo/odoo#150369
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, editing a message in message in a conversation
and then pressing on the paper plane icon was throwing the following
error:
```
TypeError: null is not an object (evaluating 'thread.model')
@_sendMessage
```
This happens because this button was in "send" message mode rather
than in edit mode. Since we cannot post a message while editing a
message, the crash happens because composer is not related to thread
but the message.
This button is not visible in desktop mode, and user should use
suggested keyboard shortcuts or click on links to either save edit or
discard it. In mobile, these interactions are not intuitive.
This commit fixes the issue by keeping the paper-plane button while
editing in mobile but it acts as "save". The labels to save/discard
was not appropriate in mobile, so it has been turned to a simple
button to discard editing.
opw-3670482
closesodoo/odoo#148918
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, opening chat window from messaging menu
might not work.
Step to reproduce:
- open Discuss app
- Go to home menu
- Reload the page
- Click on Messaging Menu
- Click on chat item to open chat
=> Chat window is not open
This happens because when in the home menu from Discuss app
in background page reload, the URL contains the Discuss app
menu_id, but the action is "menu" rather the action id. This
difference is crucial to distinct discuss app being actively
open or it's in the background from home menu. The latter
should NOT consider Discuss app being open.
This is not a problem when opening/closing Discuss app, because
the mounting/unmounting of the Discuss app component is good
enough to detect that. However, with page reload, the way to
detect Discuss app being open from URL was only relying on `menu_id`
instead of `action` value.
This commit fixes the issue by checking `active_id` of discuss app
rather than `menu_id`, as `active_id` is 100% reliable whereas
`menu_id` is not. The problem with home menu is one example among
many other cases (e.g. page reload in channel settings form view).
closesodoo/odoo#149969
Related: odoo/enterprise#54638
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: mail
This commit fixes the behavior of the notification to install the PWA.
The initial spec was not completely achieved, since the 'Dismiss' button,
using the fa-close icon was not present. See task-3275275.
Now, the button is present, and it can hide the notification and the user don't
need to interact with the installation prompt to dismiss it.
The fix also fixes the behavior of the notification when being used in
an incognito tab. The installPrompt service assumed the PWA could be
installed, since window.BeforeInstallPromptEvent is defined. But in an
incognito scenario, the event was never actually triggered, since the
feature is disabled by the browser.
This could finally create a UX issue if the app had been installed, and the
localStorage cleaned. The notification would appear, but wouldn't do anything
when clicking on the Install button since the event is no longer triggered by
the browser. Now, we rely on the trigger of the event exclusively, except on
Safari, where we rely on the installationState and the standalone display-mode.
Now, the service only set its state when the event has effectivelly been
triggered and the native prompt can be called. Since the UI relies on the
state from the service, the notification is no longer shown.
Tests have been adapted, to dispatch a custom event, allowing the service to be
initialized as if it was in a situation where the PWA can be installed effectively.
A new test have been added to verify the interaction with the close icon.
closesodoo/odoo#149961
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Since [1], the `insert` method accepts the `html` option to
automatically cast record fields marked as `html` to markup. Before
this PR, this option was ignored after the first insertion if the
field value remained the same.
Steps to reproduce this issue:
- Insert a message without passing the `html` option: the body field is
an instance of string.
- Insert the same message setting the `html` option to true: the body
field of the message is still an instance of string while it should be
an instance of markup.
This PR fixes this issue.
[1]: https://github.com/odoo/odoo/pull/139501closesodoo/odoo#149953
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Before this commit, any new message in a channel of type "channel"
was automatically opening a chat window and showing new message
counter in tab title when out-of-focus.
This behaviour is only intended for important messages. In chat
(group chat, DM chat, livechat), all new messages are considered
as important so this is good. However, for channels, these are
intended for communication with many users, and we only want to
notify on messages that are explicitly flagged as "needaction".
As a reminder, message are needaction through `@mention` or
reply-to for example.
This commit fixes the issue by limiting notifying out-of-focus of
new messages in channel "channel" to only needaction. Also the
auto-opening of chat window as a consequence from this new message
is also limited to needaction messages.
closesodoo/odoo#149943
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when looking at old messages of a message,
clicking on "Jump to present" was frequently not scrolling to
most recent message.
This happens because loading messages is not immediate, and thread
UI has some heuristics to adjust scrolls that were working against
scrolling to present when the RPC to load messages around present
is not immediate.
This commit fixes the issue by handling the actual scroll to present
in the same workflow as all other scroll adjustments. Also the logic
for adjusting scrolls requires immediate scrolling, hence this commit
has to remove smooth scrolling to comply with current scroll
adjustment techniques.
closesodoo/odoo#149915
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to Reproduce :
1. Open Email Marketing
2. Type a long text in the subject line
3. You will notice that the content gets overlapped over the emoji icon
Observed behavior:
content getting overlap over emoji icon
Expected behavior:
the content should be hidden by the emoji icon
Task-3628324
closesodoo/odoo#149918
X-original-commit: 80c96838a4d16a821aaf11e04ca2776f6a884507
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Sanket Brahmbhatt (sabr) <sabr@odoo.com>
This reverts commit 185adf6fb487fa260bb6dfe985638bc545de7fa2.
The change was made to "fix" line breaks with rating feedback in
helpdesk. However, it's not ok to apply `inline` display layout
for all non-user made message body, as usual block display is
expected for html tags like `<div>` or `<p>`.
The correct fix should be to remove these unwanted `<br>` in the
feedback rating messages. We don't know how they appeared, but
this is a specific minor issue in helpdesk rating, so reverting
the fix is a higher priority.
closesodoo/odoo#149570
X-original-commit: 1ba04da76f391cd4543a8d3b1e6dbecf6a2cb558
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Currently the form sheet have a flex-grow-1, the chatter could use less
horizontal space to leave more space for the form sheet's content.
This commit widen the form_sheet by applying a flex-grow-2 and
reduces the chatter's top bar total width by removing the icons and
applying a sup tag on the micro information displayed aside the icons.
Since the icons are removed there is no need to test if the icon is
rendered with it's appropriate text anymore thus we can remove these
two lines. Additionally the `text-warning` on the span was unnecessary
since it's already applied on the button parent.
task-3641988
closesodoo/odoo#147136
Related: odoo/enterprise#53208
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: mail, pos_sale, pos_self_order, website_sale
=== `oi-close` adaptation ===
Prior to this commit, `oi-close` icon was based on the default
sans-serif font. Depending on this, there could be alignment and size
inconsistencies with the Odoo UI icon library.
This commit adapts `oi-close` to use a custom icon from the UI icon
library to make it more robust and maintain consistency with this
library.
=== corner arrow icons adaptation ===
Prior to this commit, directional icons related to the four corners were
misaligned.
This commit adapts these four icons so that they are properly aligned.
task-3618046
closesodoo/odoo#144598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Label of guest name on public discuss welcome page
was gramatically incorrect. It should be "Logged in as"
rather than "Logged as".
Also took the opportunity to properly translate the label.
closesodoo/odoo#149187
X-original-commit: 9463c787e7804e5c2c525b9ecc096ee067f0dd3d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In this commit we have fixed the line break issue when we submit a feedback
for task and ticket.
steps:
- Install helpdesk
- Go to helpdesk > team
- Activated customer rating
- Set the rating template in the ticket stage
- Create a ticket with the customer and move to the next stage
- Open the mail and submit a rating and message
- Open ticket and check customer message
task-3268763
closesodoo/odoo#148644
X-original-commit: 185adf6fb487fa260bb6dfe985638bc545de7fa2
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce:
- Install `CRM` module (for test purposes)
- Create a lead and set the name, email, phone, company name and
contact name
- Save the lead
- Click on `Send message` button in the chatter
- Uncheck/Check the recipient checkbox
- Save the partner
- Discard the changes on the lead and open the partner created
Issue:
- In the wizard, the `phone` value is not set with default value and
the name is set with the company name instead of the contact name
- On the partner created, the company and phone are not set
Cause:
The default values (used in the partner creation wizard) retrieved
from "/mail/thread/data" route are not set on the recipient object.
opw-3512045
closesodoo/odoo#148213
X-original-commit: 372fe2fe61e3121b27bf1305dfac8fbf0ff8e9b5
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Before this commit, it was possible that an attempt to update
peer connections made right at the moment the connection was swapped
from peer-to-peer to server mode. Which would cause a traceback.
This commit fixes this issue by checking if there is a
`RTCPeerConnection` before trying to update it.
closesodoo/odoo#148505
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When a message had more than 1 attachment, it was not possible
to preview the attachment on a mobile device.
This happens because the hover buttons for delete/download the
file took the whole clickable area of attachment to see the preview.
To enable quick actions in mobile, this require non-trivial UI
tweaking. To match behaviour of version 16.0, these quick-actions
have been disabled in mobile.
opw-3664795
closesodoo/odoo#148091
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Internal code doesn't need to use reactive when reading store or Model,
especially not in `insert` that is not meant to access anything observed
except when actually writing records (in which case `_proxy` is used).
The `get` part of `preinsert` (and its full chain) must be kept with the
full proxy however, to ensure proper trigger of reactive callback when
returned record changes.
Part-of: odoo/odoo#147814
There is no need to go through the proxy to assign localId as nothing
should observe it at this step, and it shouldn't change anyway.
Part-of: odoo/odoo#147814