This commit passes systray activity menu as `self` in the qweb
context of the template of activity previews.
Task-Id 2034580
closesodoo/odoo#35248
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Before this commit, when a user received a needaction notification
on a message already stored locally, it crashed with this error:
`TypeError: Cannot read property 'getThreadIDs' of undefined`
This is caused by `addMessage` returning a Promise not resolved with
the message when the message is not new. The returned promise should
always be resolved with the message, in order to be consistent.
closesodoo/odoo#35724
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Revision on https://github.com/odoo/odoo/commit/e8f7770a13d6ddc1cb8ec1bcebcb22e21962ba52
Commit above fixes an issue with chat windows being open twice.
It fixed the issue by aborting opening a chat window in case a
chat window is already being open.
Opening chat window may be a slow process, due to requiring fetching
some messages beforehand. This operation is necessary in order to
check whether the user has access to messages or not, and prompt an
error message without opening the chat window in the latter case.
The fix did not respect the specs of the method `openThread`: it
pre-emptively returned nothing, instead of returning a resolved
promise. Because of this, it crashed on `undefined.then()`.
Task-ID 2053095
closesodoo/odoo#35722
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Before this commit, The dropdown menu remained open after clicking on
activity icon.
After this commit, The dropdown menu is closed whenever the activity
icon is clicked.
Task-Id: 2047408
closes: #35568
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before, If direct chat or channel has no any message in chat history, then
send button is not clickable in discuss.
Now, fix in scss file will allow to click send button for channel and chat.
Task : 2037292
Closes#35570
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, we may have the following error:
`TypeError: Cannot read property 'html' of undefined`
This happened in the following scenario:
Terminology:
- in multi-tab environment, there is a master tab and slave tabs
- master tab fetches notifications from the server and forwards them
to slave tabs
State:
- 2 logged-in users: Michell & Marc
- Mitchell has open 2 browser tabs
- Mitchell has a pinned private conversation with Marc
Steps:
- Mitchell has focus on a slave tab
- Marc posts several messages to Mitchell in very quick succession
=> Mitchell gets crash error above.
This issue is caused by chat window being registered in mail manager
while it has not been mounted to DOM. On receiving 2nd new message,
it has to re-render chat window header in order to update displayed
unread counter. However, this fails due to chat window having no DOM
node yet.
This commit solves the issue by mounting chat window to DOM before
being registered in mail manager. That way, on receiving 2nd new
message, it does not trigger a re-render on chat window that
is about to be mounted to DOM, since it has not been registered yet.
Note that the displayed unread counter will be correct, because it
uses the up-to-date unread counter on mount.
Task-ID 2050108
closesodoo/odoo#35601
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
The emoji was displayed in the list of choice but was not correctly rendered
when sent to the server.
Similar to 0e3d5941da but for broken heart
closesodoo/odoo#35367
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
As the 'allow_company_ids' are now depending on the context and impact
the access to some data, we need to provide them to some controller
(route). Json route auto-pop the context when given (0322f77279)
into the environment. In the 'read_follower' route, the `check_access_rules`
raises when you want to access a document of another company (even if
this one is in your allowed companies), simply because their is no
'allowed_company_ids' key in the context. This context key is automatically
added when calling the `rpc` method in JS (as explain in session.js
of a5b6f31cf2).
To fix the wrong access error on followers reading, we simly have to give
an empty context when calling `_rpc` in the follower widget.
Task-1999686
closesodoo/odoo#35705
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Removing these margins makes swipe on 'o_mail_preview'
nicer in enterprise without having blank spaces.
Note that these rules should be in enterprise.
Task ID : 1895453
This allow us to reuse this logic in enterprise when you swipe.
Note that we could have directly called the handler but the name
wasn't appropriate. So we preferred to extract some code in a
well named function.
Task ID : 1895453
This commit allows a livechat operator to send a chat request to a
connected and available website_visitor.
A visitor is considered as connected if his last tracked website.page request
was within the last 5 minutes.
A visitor is available if he doesn't have an active livechat conversation
(mail_channel with type = livechat).
- If another operator sent him a chat request
- Or if the visitor asked himself to speak with an operator
(via the normal and existing flow)
A livechat conversation is active while the visitor haven't left the conversation.
An operator cannot leave a livechat conversation, only the visitor can.
The flow to send a chat request:
- On the visitor view (tree or form), operator click on 'send chat request'
(button or livechat icon)
- A empty conversation with the visitor pops up at operator side.
- While the operator didn't send a message, the visitor won't see the conversation.
- The operator can type a message to the user
- If the operator close the chat without sending any messages,
the chat request AND the mail_channel are both deleted.
In this case, the visitor is then available to send him a new chat request.
- If the operator send a message, at the visitor's next action
(page navigation on pages that allows livechat, based on livechat rules),
the conversation will pop up at visitor side, using the livechat button widget.
The visitor won't be able to request a livechat conversation with an operator until
he leaves the chat requested by the operator.
- Once the visitor leaves (with or without rating) the conversation :
- the operator is notified that the visitor has left the conversation
- the chat request is deleted to keep the chat request table clean and minimal
- the livechat conversation if set to inactive.
- The visitor is now available again to send him a chat request.
This feature uses the already existing livechat_session cookie mechanism,
so no further code modification was needed to make this work.
It's directly integrated is existing livechat flow.
The chat_request model is only useful to quickly check if a visitor has a chat request
and to send the livechat conversation info to the visitor via the livechat_session cookie.
This commit also add a website_visitor banner info on discuss view :
To be able to quickly see all the relevant information of a website visitor
while talking with in discuss view, a fixed banner have been added.
Only the discuss view will benefit from this because detached chatter window
is to small to display such banner.
Task ID: 34624
PR #2028059
In the chatter composer, suggested partners were shown more than
necessary.
1. Create a new partner;
2. Open the chatter composer to send a message
(the new partner is suggested as a recipient);
3. Re-open the chatter composer
=> the partner is still suggested, but it is already a follower now!
Task-Id 2050102
closesodoo/odoo#35604
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: jbm-odoo <jbm@odoo.com>
Before this commit, most new messages added to the mail manager were
handled as if recently posted from a document thread. As a result, it
was frequently setting a new item in the local storage to notify
other tabs from these new messages.
The intent of this behaviour is to notify other tabs of newly posted
messages in a document thread, without using a longpolling
notification. That means this logic should only apply on messages
that have been recently posted on a document thread.
Sometimes, this issue was breaking the local storage on Firefox.
It showed the error message "Quota Exceeded Error" whenever `setItem`
was used, even when items were removed beforehand. The capacity of
the storage was only a few Kbs on this domain, far from reaching the
maximum capacity. We think that this error comes from the concurrent
`setItem` on multiple tabs, but this is very hard to reproduce.
This commit fixes the issue by limiting the `setItem` to the tab
that really posted the message. Tests have been adapted in order to
pass only with this fix.
note: backport of 12.2 4bde721f9
opw-2031960
closes#35588
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The purpose of this task is to add a visual indicator on kanban and list
views when there is an exception activity on a record. To do so, two
fields have been added on the activity mixin that determine if the record
has an exception activity and its corresponding icon.
When there's an exception activity, the next activity icon is different
in the kanban and in the list view, the icon is displayed at the end of
the column with no label.
Prefetching all activity_type_ids in compute will allow to lessen
queries (3 query for this compute) and cache may benefit to other
mail.activity.mixin computed field, like activity_state in kanban view
Task 1889379
All activity filters are now invisible in the corresponding search views.
These filters were only used by activity redirection (when clicking on
the activity item in the systray) so we hide them to reduce the noise
for the user.
"My Activity" filter has also been removed, its corresponding domain is
now directly set in the action where it was used.
Task 2036392
This commit adds a new mailbox in the Discuss app called 'History'.
Messages that have been marked as read are moved to 'History'.
Notifications are required to link history messages to users. So
notifications are now deleted after they are more tha 6 months old.
This means History mailbox keeps less than 6 months old messages.
Note that this feature only works when user notifications are handled
in Odoo. This can be set in the user preferences, under the
"Notification Management" section.
Task-ID 402597
Create an activity in a chatter, mark it as done, click inside the
textarea, the popover is automatically closed.
The `click` trigger both opens and closes the popover on click.
opw-2028399
closesodoo/odoo#34982
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The big images are probably never going to be used for the following models:
- pos category
- fleet brand
- livechat channel
- mail channel
- payment acquirer
And if big images are needed some day the model should use image.mixin instead.
PR: #34925
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
what was previously the big size)
+ add new intermediate format:
image_512
PR: #34925
When posting a message (here is the livechat use case),
the _postMessage function can call the callback function.
but this parameter is not mandatory.
If the caller of this function doesn't need a callback function
to be called after execution, the _postMessage function was crashing
as callback is not defined.
This commit fix this _postMessage function by checking that
callback is defined before calliing it.
Pre-required for Task ID: 2028059
Fix Task : 2037048
PR #34917
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit replaces the usage of `formData.delete()` as it is not supported
by Internet Explorer and Safari Mobile.
closesodoo/odoo#34787
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, if we had a livechat channel with a user and:
- in backend use command "/leave" to leave and unpin conversation
- [do not reload the page (or there is no issue)]
- then the user sends a new message
The chat window opens just with the new message. Fetched previous
messages are ignored due to being already in the mail manager, and
links between these messages and the threads were never updated.
With this commit, when fetching messages that are already in the mail
manager, these messages are linked again to threads.
This commit also fixes an issue in which messages moderated with
status "accepted" were not correctly removed from the moderation
mailbox. This problem occurred after the fix on re-linking messages
to threads.
opw-2031270
closes#34761
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when a direct message chat was renamed, it
crashed with the following error:
`TypeError: Cannot read property 'toLowerCase' of undefined`
This occurs because the name of the dm chat changed from the RPC
response. However, no new name was provided, thus it sets its
name to `undefined`.
Test has been adapted in order to reflect that the server does not
response with new name after RPC `channel_set_custom_name`.
closesodoo/odoo#34641
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Before this commit, the close button on the thread window was
too small to click on it. The padding of the button wasn't over
the all available area.
After this commit, the padding of the close button is higher and
so the user can target it more easily on a small screen.
We had to reduce the padding of the parent.
Step to reproduce:
- Open the "Discuss" app
- Go to the "Channels" tab
- Open a channel
- Try to tap on the close button on the top left window
Task ID : 2033828
closesodoo/odoo#34977
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>