In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().
task-3292454
closesodoo/odoo#130179
Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
When on helpdesk app (or any app with an activity view), if you go on the
activity view while having activities due on a previous year it will
cause a traceback "TypeError: date.toLocaleDateString is not a function"
This happens because the function tries to call toLocaleDateString on a
datetime variable, not a date one.
opw-3432005
closesodoo/odoo#130090
X-original-commit: 81ec723b3956f198d5de99a5a4214359f67b8327
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when editing a message in chatter and
typing `@` to display mention suggestions, the list changed
position between `top` and `bottom` based on content size of
suggestion list.
This happens because by default suggestion list in composer are
positioned `top`, as most composers are at the bottom of screen,
and message to be edited are recent messages, which are usually
at the bottom of screen.
Chatter is special in that composer is at the top of the screen,
and recent messages are shown at the top of screen too. The better
position in this configuration is `bottom`.
Condition was on composer being linked to chatter thread, which is
the case when posting a message for the 1st time. While editing a
message however, the composer is linked to a message and not a
thread, therefore the condition `thread?.type === 'chatter'` was
falsy and default position `top` was chosen. Due to position being
a recommendation and placement of composer at the top of screen,
with many mentions it was displayed at `bottom`, and with few
suggestions it changed to `top`.
This commit fixes the issue by relying on the context of the
composer with `env.inChatter`, which covers all chatter used in the
displaying of chatter with composer at the top, including when
editing a message.
closesodoo/odoo#130106
X-original-commit: a03705d0f55e887ec05cb41d7cf86db748f77955
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Since the relational model was rewritten (PR 114024), it is now reactive,
so it is no longer necessary to use model.notify() to render the view.
closesodoo/odoo#130058
Related: odoo/enterprise#44781
Signed-off-by: Aaron Bohy (aab) <aab@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#128752
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
*: im_livechat, website_livechat.
Before this PR, services has to be added to the setup manager in order to be loaded in tests. This was cumbersome because the setup manager was patched by each sub-feature to add feature related services to the registry. The same had to be done for systray/main components registries.
This PR automates this process in order to remove the patches.
closesodoo/odoo#129705
Related: odoo/enterprise#44596
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Since [1], switching from one record to another in a form view
would send two `/mail/messages` rpc. This is due to the
`onWillLoadRoot` hook that triggers a `MAIL:RELOAD-THREAD` event
while the thread is going to change. As a consequence, messages
are fetched for the currently active record and the one that will
be activated.
This PR fixes the issue by ensuring the thread won't change before
triggering this event.
[1]: https://github.com/odoo/odoo/pull/114024closesodoo/odoo#129869
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Before this commit, scrolling inside the messaging menu in mobile
was stuttering.
This happens because the dropdown is in full screen, and whenever
there's a scroll inside this dropdown menu, the position is
recomputed from internal `usePosition()` hook of `Dropdown`.
The repaint of recomputing this position is costly because of
using `bottom: 0` and having images in notification items that
have transparent background (e.g. chatter notifications).
This commit fixes the issue by defining the height of the messaging
menu dropdown in mobile without `bottom-0`. This drastically eases
the repainting for fixed position. `ActivityMenu` had the exact same
problem, so it is also considered in this fix.
closesodoo/odoo#129859
X-original-commit: 67af0ac45dcea55f52ee7ffbc253827d665d7ac6
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Steps to reproduce:
- Open barcodde app
- Go to Operations > Delivery Orders
- Click on avatar button to open chat
- Click on back button
Traceback:
```
Cannot read properties of null (reading 'click')
```
This happens because closing the chat window attempts to
open the messaging menu in mobile. This assumes chat
windows are working in `/web` and the systray is available.
Barcode app is special because it's in `/web` but the systray
is not available.
This commit fixes the issue by opening the messaging menu if it
can, otherwise it silently does nothing.
Task-3439660
closesodoo/odoo#129858
X-original-commit: 399f191dc1bb40d352890607413fa72462f1a99d
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This PR fixes an issue were link previews could overflow
the chat window.
closesodoo/odoo#129829
X-original-commit: 24de4e1adc9ad427daa7319480fc8004cde626dc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, chat windows state (open/close/folded) was not
syncing between browser tabs. This lack of feature makes using chat
in crosstab quite inconvenient.
This feature exist in 16.2 and was mistakenly removed from rewritting
of Discuss code in 16.3. This commit reimplements as it was in 16.2.
Task-3435120
closesodoo/odoo#129812
X-original-commit: 8f27d1f254e79becf6886cdb90a1af14b28e9946
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
As of Owl 2.2, it is now possible to use iterable directly in t-foreach
without having to convert it to array first.
This commit takes advantage of this new feature to remove the
unnecessary array conversions from the Discuss code.
closesodoo/odoo#129765
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit adds the possibility to see additional information about a
user with a card that appears when hovering avatar user fields for a
set amount of time. This card contains the following information:
- Avatar
- Chat status
- Name
- Email
- Button to send message
and with HR installed:
- View profile Button
- Job position
- Department
- Phone number
- Advanced chat status (when hr_holidays is installed)
Task-3167110
closesodoo/odoo#121943
Related: odoo/enterprise#44563
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Before this commit, the dropdown menu lacked spacing at the top and
bottom when a user clicked on "Followers" in the chatter.
This commit addresses the issue by adding the necessary spacing and also
adjusting the hover state background color (when hovering followers
details and actions) to improve the contrast with the text color.
task-3338438
part of task task-3326263
closesodoo/odoo#129760
X-original-commit: 8f65cd97cd0127e66d51537a5fce835012dca7f0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This PR focuses on partner invitations for livechat channels:
- Add "invite a user" button to the member list
- Sort partners by availibility (partner is a livechat operator
and connected) then most invited users (by the current partner)
- Display partner lang of suggested partners
part of task-3332872
closesodoo/odoo#128834
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Follow-up of https://github.com/odoo/odoo/pull/128650
The edited label is disabled because showing the label introduces
problems that have no good solution with the current implementation
to determine a message is edited.
The label was removed but the condition to determine whether a
message has some text content was not updated accordingly.
There was a special condition for showing "(edited)" label when
a message is edited to remove the text content but has some
attachments. Since the label is no more, the presence of text
content is the only thing that matters for this getter.
closesodoo/odoo#129692
X-original-commit: c53e3e73978f7c25c457a0ad19798566f59c7864
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when a message had no text, the action list was
placed above the message content, including attachments.
This made it hard to find the action list for these messages, as
all action lists of any messages are expected to always be next to
the 1st line of the message content.
This commit fixes the issue by placing action list next to text
content if there are any (same as before), but if there are no text,
then the actions are displayed next to attachments.
The template requiring defining a shared container for text content
and attachments, so that action list comes after. Also when the
message has some text and some attachments, the action list is still
expected to come inline of text content, which is why this commit
conditionally places the action list accordingly.
Part of Task-3340653
Forward-port-of: #128940
X-original-commit: 43699aea88adbdeca43150e9659fc5571de333e0
Part-of: odoo/odoo#129692
Before this commit, when opening a chat on a very narrow mobile
device (e.g. 300px width), there was the following crash:
```
TypeError: Cannot set properties of undefined (setting 'hidden')
```
This happens because the computed maximum amount of visible chat
windows was 0, which prevented the good opening of chat window.
Indeed, the code relied on at least a `CHAT_WINDOW_WIDTH`, which
is 360px.
This commit fixes the issue by guaranteeing that it is always
possible to make 1 chat window on the screen, regardless of the width
of the device.
closesodoo/odoo#129474
X-original-commit: 1c9289fffe2a8d0936a1afa99255777ff275c712
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when receiving a link preview deletion
notification of an unknown message, there was a crash.
This happens because the handling of the link preview deletion
notification assumes that the message linked to the link preview
is known by the JS code. But this might be wrong in the case that
the message was not loaded.
closesodoo/odoo#129460
X-original-commit: 28beec42ac8b731170517a6aa5d7c99623a5a87c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, when editing subtype of a follower
(click on pencil icon to edit), the subtype dialog was
displayed while keeping the follower list dropdown open.
This happens because `FollowerList` makes use of
`Dropdown` and `DropdownItem`, and by default they manage
closing of dropdown item when clicking away of when clicking
on the dropdown item. However, when there are specific clickable
elements on the `DropdownItem`, the clicks do not auto-close the
dropdown menu.
This commit fixes the issue by specifically close the dropdown menu
when clicking on edit button of a follower in follower list.
Task-3435443
closesodoo/odoo#129413
X-original-commit: a33f60356ba7c12bd854eb0efe5c653ff1559495
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when using Odoo with many tabs and when posting
a message in a DM chat, the other tabs had an alert as if we received
a new message from someone else.
This happens because the condition to trigger a new message alert
were not considering the author of message, thus any new message in a
chat where triggering the sound. This only happens when many tabs
were open, because somehow the tab is sometimes not considered in
focus.
There are likely some corner-cases with `isOdooFocused` where it's
not properly syncing among tabs are wrongly considered as
out-of-focus. This bug of out-of-focus, while more delicate to
understand and fix it, is not critical and thankfully is not a
necessity to fix this problem on receiving self-messages in chats.
opw-3425658
closesodoo/odoo#129361
X-original-commit: f59805825c55663f7381204da8f0bdfe63ccd1d8
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This commit revert the changes from this PR https://github.com/odoo/odoo/pull/127377
Before this commit:
Chat window shows all 7 rtc buttons due to this the alignment of the button
is not set because there are way too many buttons.
After this commit:
This commit fixes the issue by showing only 5 buttons Mute,Deafen,Video,More,
Close call and other 3 buttons will moved in expandable More menu.
The testcases were changed accordingly.
Task-3346085
closesodoo/odoo#129360
X-original-commit: 909fb073eada42ff22c4ef4b20b44dc5536b250e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, the message actions "Add to Favorite" and
"Mark as Unread" were shown in the Discuss public page For guests.
These buttons should not be present in public page for guests,
as they both require at least the user being authenticated.
This commit fixes the issue by not showing these 2 actions
"Add to Favorite" and "Mark as Unread" on messages in the Discuss
public page as guests. Internal users can still see both features
in the public page
Task-3430586
closesodoo/odoo#129359
X-original-commit: b551f8799ccee443fc0c6a1e8d4a5e2b8e673c57
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Some groups don't have a total_count, ignore them to avoid NaN result.
This is the case of calendar meeting in particular.
closesodoo/odoo#129358
X-original-commit: f29c4f905a557bef1120ea6ea8af2edf3af93489
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, there was a hook, named useModel, which eases
the use of a model in views. The main (and almost only) role of the
hook was to deal with sample data (determine whether or not they
can be enabled, fallback on the sample orm when necessary, leave
sample mode at reload...). This hook is used by all views except
form and activity as they do not implement sample data.
This commit renames that hook into "useModelWithSampleData" and
introduces a new hook "useModel", which is a lot simpler that the
other one, as it's only goal is to do the plumbing between the
component using the hook and the model (i.e. spawning required
services and loading the data on willStart and willUpdateProps).
This new hook is used in form and activity views.
Note that useModel doesn't trigger deep renderings, as it is only
used on the RelationalModel which is based on fine-grained
reactivity.
Part-of: odoo/odoo#114024
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.
Main changes that were requested are:
- record datapoints no longer always have an "id" key in their
data (they still do if the id field is in the view), so we use
record.resId instead
- the new model is based on fined-grained reactivity, so several
components that previously relied on onWillUpdateProps to update
their internal state no longer worked. Typically, using the hook
"observeRecord" is the way to go now.
- specialdata are no longer handled in the model, so the components
needing specialData can use the hook "useSpecialData"
- more generally, all overrides of models (RelationalModel or
KanbanModel) needed to be reworked.
Part of task~3179751
Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.
In this commit,
the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.
Example :
registry.category("web_tour.tours").add("example", {
test: true,
steps: () => [
{...},
{...},
],
});
task-3292454
closesodoo/odoo#124157
Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Before this commit, livechats in mobile were shown in the "Chat"
tab in both discuss app and messaging menu. This is alright, but
there's a dedicated tab for "Livechat", which was empty as a result.
The intended showing in mobile is to keep livechat away from "Chat",
and instead populate the "Livechat" filter.
Task-3430253
closesodoo/odoo#128934
X-original-commit: cf4b72582bbb52c7cd4bc17733f4dbbc84f9b321
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, the `keydown` and `keyup` events of the call feature
were in bubble mode, which could prevent them from operating when some
other listeners would prevent the propagation of the event.
Since push-to-talk is supposed to always be usable, the listeners
are now in capture mode.
It was first made apparent with the addition of a `stopPropagation()` in
the `chatWindow` here: https://github.com/odoo/odoo/pull/127638closesodoo/odoo#128897
X-original-commit: 1466a6bc471ed583966e959b47f10bdc64837732
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The opportunity is taken to make the feature reactive.
Also fix traceback if favorites can't be fetched from external API.
Part of task-3265211
Part-of: odoo/odoo#128799
This commit uniformises the different discuss option
panel by introducing a dedicated component.
Before this change, every single discuss panel would
look different: font size/weight, text in lower/upper
case, margins...
Moreover, in the chat window, the close panel button
was absolute positionned which could overlap with the
content of the panel. Moreover, the cross icon looked
strange with the one of the chat window header.
This commit introduces the `ActionPanel` component in
order to solve those inconsistencies and replaces the
cross icon by an arrow left one.
part of task-3332872
closesodoo/odoo#128742
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Clicking on chatter notification from the messaging menu should
either open chat window or form view, depending on whether the
discuss app is closed or open respectively.
Before this commit, when discuss app was open and user clicks on
messaging menu item related to chatter notification, it was opening
the chatter in discuss app. Although it works, some features seem
missing, such as lack of chatter-specific features, and missing
entry in the app sidebar. The discuss app is designed to work
only on `discuss.channel` threads, therefore chatter threads should
never be shown inside this app.
This commit fixes the issue by ensuring that all opening of chatters
from the discuss app opens the form view.
closesodoo/odoo#128809
X-original-commit: 94c12dd231212e2e52b626a380344623c8627d7c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit implements a new widget in mail, `StatusBarDurationField`. Purpose:
seeing how long a record has spent in each stage in a form view.
It is implemented for records with a `many2one` status field and gets the data
from the `duration_tracking` field of the record. `duration_tracking` is computed
by adding the `mail.tracking.duration.mixin` to a model.
Time is shown using a luxon Duration object. "narrow" specifies that time is
expressed with one character and luxon takes care of translations.
Task-3032773
Part-of: odoo/odoo#108554
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>