Before this commit, new messages from odoobot were never opening
a chat window automatically.
This is desirable only during the onboarding process of the user,
when first logging-in, as to not bully the new user. It is not
intended to prevent all new messages from odoobot.
This commit fixes the issue by only preventing auto-opening of
chat window of odoobot for the 1st step of the onboarding process.
closesodoo/odoo#132689
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
* = hr, im_livechat
The real service works just as well, gives more guarantee on what is
actually tested, and requires less lines of code.
closesodoo/odoo#132744
Related: odoo/enterprise#46108
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, when the user tries to access to activity view,
a traceback is occurred because `ctx.__comp__.evaluateBooleanExpr`
is not a function used inside the template of `ActivityRecord`.
That function is in fact used in the view compiler but the
ActivityRecord component does not have that function defined.
This commit defines that function in `ActivityRecord` component to
correctly compile its template.
Steps to reproduce:
------------------
1. Install Project
2. Go to Project > Tasks > My Tasks
3. Select the activity view of `project.task`
Actual behavior:
---------------
A traceback is occurred saying `ctx.__comp__.evaluateBooleanExpr`
is not a function.
Expected behavior:
-----------------
The activity view should be loaded as before.
closesodoo/odoo#132610
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
* = account, calendar, im_livechat, mrp, project_todo, sms, snailmail,
test_mail, web, website_livechat
`contains` is more efficient than `afterNextRender` as it does not wait
for several extra animation frames, and it is functionally more
meaningful.
closesodoo/odoo#130451
Related: odoo/enterprise#44999
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
`QUnit` tests require at least one `assert`. This change allows to write
tests that only contain `waitUntil` without extra `assert` in the test.
`waitUntil` is more efficient than `afterNextRender` as it does not wait
for several extra animation frames, and it is functionally more
meaningful.
Currently existing tests that contain `waitUntil` have been adapted
accordingly. More and more tests should make use of it in the future.
Part-of: odoo/odoo#130451
Before this commit, when chatter data were fetched, it shows
spinner icon on attachments immediately until data are fetched.
This RPC is quite fast, so it's annoying to see spinner and then
no spinner whenever chatter is reloaded. This is even more
bothersome when most chatters have no attachments and some followers,
which gives the illusion loading affects followers rather than
attachments, as the spinner takes place of attachment counter that
is empty when no attachment.
This commit fixes the issue by having a 1 second delay for showing
the loading icon next to attachment. This prevents most flickers
when RPC is fast, while keeping it relevant when it's slow so it's
clear data are still loading.
Task-3356922
closesodoo/odoo#132463
X-original-commit: 96b00d25becdf2253975d1b427c30ee287cda98f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit:
JS errors on iOS with Safari's browser due to the date syntax not being
supported:
```js
new Date("2023-08-18 14:02:53")
-> Invalid Date
```
This does prevent Odoo's backend to start up on the browser and the app
on iOS devices.
opw-3465337
closesodoo/odoo#132461
X-original-commit: a39391d0df644fce86f435ba3f39e7634d8e5172
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, closing a hidden chat window may crash.
This happens because closing a chat window was always treated as the
closing of a visible chat window, which should make the 1st hidden
chat window visible, if any. This code should not be called when
closing a hidden chat window, otherwise unexpected behaviour are
to be expected, e.g. closing 2nd hidden chat window swaps last visible
with 1st hidden chat window, or even a crash.
This commit makes sure auto-swapping of 1st hidden chat window only
occurs when closing a visible chat window.
opw-3460466
closesodoo/odoo#132458
X-original-commit: b49364b687757385a2a7356d17dc428edafd2767
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit allows to take domain into account for custom activity
groups in the systray.
Steps
=====
In debug mode:
- Install module mass_mailing_sms
- Add an activity for a mailing.mailing record with mailing_type set to
'sms' (i.e. a record visible in the SMS Marketing app).
- Add an activity for a mailing.mailing record with mailing_type !=
'sms' (i.e. a record visible in the Email Marketing app).
- Open the activity menu
Not in debug mode:
- Do the same step as above
- Click on the category "SMS Marketing" in the activity menu
Issue
=====
- In debug mode: a traceback will pop up when the activity menu is
opened with an error message similar to `Got duplicate key in t-foreach:
1182`.
- Not in debug mode: when clicking on the SMS Marketing category in the
activity menu, all records of model mailing.mailing with activities set
will be displayed and not only the one with mailing_type set to 'sms'.
Cause
=====
- In the method systray_get_activities, the id of each model is used to
create groups of activities. In mass_mailing_sms, the same logic is used
but two groups are created for the model mailing.mailing, thus with the
same id. This create a traceback in debug mode when displaying the
activity menu are the id of the groups are used as key for a foreach in
the view template.
- The methods openActivityGroup and onClickAction called when the user
click on an activity group (or on the activity icon next to it) do not
take the domain of the group into account correctly.
Fix
===
- The id key of activity groups is renamed in sequence
- The value of sequence is only used to sort activity groups on the
client side
- group_index is used as t-key value in the template of the activity
menu
- The domain of each group (if any) is combined with the domains used in
openActivityGroup and onClickAction
closesodoo/odoo#132402
X-original-commit: 1f154b4ba21e34c9021f07c5e62d8de460eb824e
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, when mouse hovering on relative time of the
message, it showed the datetime without the seconds.
Not showing the seconds can make it hard to determine chronological
order of 2 messages in different conversations.
This commit fixes the issue by showing the seconds in datetime format
of message when mouse hovering on relative datetime part.
opw-3423016
closesodoo/odoo#132376
X-original-commit: b0019f5b92b9cebab9f1162631cbf00be5101b6f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: im_livechat.
Before this commit, suggestions were not showing anymore after
search/fetch returned no results. This commit fixes the issue
by resetting the search state when nothing is found.
task-3459933/3455060
closesodoo/odoo#132264
X-original-commit: 13b3f36a0d71bb55e2ca56fd207c7dfaba23aa86
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :
<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>
task-3292454
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Before this commit, messaging menu items of type chat show the
author name in body part. This is redundant with name of
conversation that is usually the name of the correspondent.
This commit does not show the name of the author in notification
item body when it's the same as correspondent of conversation.
closesodoo/odoo#132210
X-original-commit: 4b146aa70c721162b3741486246936af74f77f36
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit adds some discuss-related options in the command
palette.
- hotkeys to add channel (C) & chat (D), and start a meeting (M);
- namespaces `@` or `#` show mentionned and recent conversations
in Discuss app when search is empty;
Items show optional badge with needaction counter.
Mentions/Recent categories are only visible when there are no
search term. Indeed, `@term` searches for users while `#channel`
searches for channels, so these categories are meant to quickly
jump to recent and important conversations. When typing some
search terms, the fuzzy search has precedence over mentions/recent
criteria.
task-3330218
closesodoo/odoo#128896
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.
closesodoo/odoo#131278
Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
Part-of: odoo/odoo#130467
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.
closesodoo/odoo#123932
Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Before this PR a huge padding was present when editing a message
on the chatter. This commit fixes the issue.
task-3458670
closesodoo/odoo#131432
X-original-commit: 332942109b0db7a96da3bd2e7f2cafe19ebb1df3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This PR cleanup service typing:
* Introduce `addons/mail/tooling/type/services.d.ts` to automatically type
services imported by `useService` hook.
* Correctly type service constructor, setup and start functions.
* Remove now useless `@type`.
* Removing `Object.assign` for services variables.
* Type OdooEnv.services to services.
closesodoo/odoo#131192
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: bus, calendar, im_livechat, web, website_livechat.
This PR adds the possibility to set the current user during tests as
well as the mail guest. This will be used to test mail guest page and
livechat once the visitors will be treated as guests.
part of task-3332628
closesodoo/odoo#130811
Related: odoo/enterprise#45331
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
With this commit, users can send voice messages in channels and chat.
There's a new button in composer to record audio from the microphone,
up to 1 minute clip duration. This adds a voice attachment with its
dedicated voice player that shows waveforms and allows playback.
To ensure compatibility in all supported browsers, we choose to
encode voice recording with `audio/mp3` thanks to lib `lamejs`.
Task-3240168
closesodoo/odoo#117036
Related: odoo/enterprise#45482
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, the follower loading spinner was shown
for draft records until it was saved. This is incorrect,
follower count should instead be 0. This commit fixes this
issue.
closesodoo/odoo#131224
Signed-off-by: Didier Debondt (did) <did@odoo.com>
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.
task-3292454
closesodoo/odoo#130865
Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Before this PR, RPC in the channel invitation form could resolve in the wrong
order and display outdated result.
This PR introduce the use of `useSequential` hook witch ensure that irrelevant
RPC are canceled.
closesodoo/odoo#131011
X-original-commit: 7d628b6a2785a4ac2a1081413e8a54c7ad695cb5
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Since [1], marking the activity as done from the activity popover
was not automatically closing it.
Steps to reproduce:
- Open Contact kanban view
- Schedule an activity on a contact
- Click on activity widget on kanban card
- Edit activity and mark it as done
=> The activity popover was not automatically closed
Also fixes a bug where marking activity as done in activity view
was crashing.
[1] https://github.com/odoo/odoo/pull/114024closesodoo/odoo#130828
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR, RPC made by input inside the discuss sidebar could
resolve in the wrong order, witch display outdated results.
This PR ensure that only the most recent RPC is sent to the server,
cancelling irrelevant RPC.
Note: This PR also remove the support for Promise inside the
NavigableList component since it's not compatible with useSequential.
closesodoo/odoo#130767
X-original-commit: ba2d029d876f9acd7c869cc3d345cc4ed7cab00a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit removes the legacy implementation of the MockServer
and test utils making it available in the test environment (e.g.
addMockEnvironment).
Part of task~3439226
closesodoo/odoo#130671
Related: odoo/enterprise#45141
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Before this PR, the user during livechat embed tests was the admin partner while
it should be the public partner. This commit fixes the issue.
part of task-3332628
closesodoo/odoo#130429
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Those fields are no longer used since all client actions and the
studio report editor have been converted to owl.
Part of task~3439226
closesodoo/odoo#130462
Related: odoo/enterprise#45015
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Before this commit, a patch was used to modify some classes in place
but these classes were declared some lines just before the patch.
This commit replaces those patches by mixins, it's a better way to
provide a same extension to multiple classes as the extension is
done by the language.
Task: 3410198
Part-of: odoo/odoo#125716
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.
task 3410198
[1]: 19ea1ac08043e22a811630968e44715cc3bfc495
Part-of: odoo/odoo#125716
Before this commit, an event listener was added on
several registries to copy the required registry for
mail tests. The registries should be copied once when
the test suite begin to avoid side effects in tests.
closesodoo/odoo#130461
Related: odoo/enterprise#45014
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit introduces various fixes regarding the avatar card.
First one makes sure that the avatar card popover won't launch when
there is no user image associated with the many2one_avatar_user_field.
Second one prevents the card from opening when the related model is not
"res.users".
Third one allows to display the phone number of users even without hr
installed and makes sure that the work_phone and work_email are shown
in priority if available when hr is installed.
Direct fix to Task-3167110
closesodoo/odoo#129876
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Before this commit, all badge color matched the messaging menu
color badge. Most badge counter in discuss show needaction counter,
so it makes sense to have a catchy color scheme (e.g. white text on
red background).
For starred counter in discuss sidebar, the counter is meant to see
at a glance how many messages are starred, without it being too
catchy.
This commit fixes the issue by introducing a `o-muted` modifier on
`o-discuss-badge`, which displays a grey background for starred
counter.
Also fixes a bug in dark mode where badge background color was
incorrect.
closesodoo/odoo#130452
X-original-commit: de232c330140fd4156e7f416fddfce88b21e71c5
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Follow-up of [1]
Before this commit, when a message had both subtype description and
tracking values, they were displayed horizontally instead of
vertically.
This happens because [1] set `d-flex` on `textContent`, which is
horizontal by default. This assumes there's only 1 HTML node for
actual `textContent` so that message action list could be
positioned next to 1st text content line.
However, when message has subtype description and tracking values,
there is more than 1 HTML node in `textContent` and the intended
visual is showing them in `d-block`. This `d-flex` made them display
horizontally instead of `d-block`.
This commit fixes the issue by having a single actual HTML node in
`textContent` when there's a subtype description and some tracking
values. This allows to position `textContent` parts as desired
(e.g. with `d-block`) while having position of message action list
working as intended in original template of `Message`.
[1] https://github.com/odoo/odoo/pull/128940closesodoo/odoo#130435
X-original-commit: 469f46c602c842c7a7fae49e0af701e979ff18ba
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: im_livechat, web.
Since [1] the messaging service is added to the livechat embed
bundle. As a consequence, the bus service is started even when
it is not needed. This is wrong since it would lead to lots of
useless connections to be made.
This PR prevent mail services from starting the bus eagerly in
this context and adds a tour in order to prevent further errors
on this matter.
closesodoo/odoo#130059
X-original-commit: b2bcef3c3b57061ef0694a5fc3c326cc8babc818
Related: odoo/enterprise#44782
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR, the `nextMentionRpcFunction` was always undefined and therefor
never used. This could lead to some RPC being lost if the previous one was too
slow.
This PR fix the issue by directly using the `rpcFunction` that is already assigned.
closesodoo/odoo#130292
X-original-commit: fff3323cb82fb51dbbe8ac6790479530bbc51ba9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Now that most of the webclient codebase (fields, views, client
actions...) has been converted to owl, the legacy extra next tick
used in a lot of tests is no longer necessary. This commit removes
the helper and its usage. At some places, a real tick was needed,
but we didn't see it because of the use of the legacy extra next
tick.
Part of task~3439226
closesodoo/odoo#130236
Related: odoo/enterprise#44869
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
The `cleanTerm` function was throwing a TypeError ("term.toLowerCase is
not a function") when the email value of a contact was falsy (like
`false`, `null`, or `undefined`), as it was attempting to call
`toLowerCase` on a non-string value.
This was particularly problematic when two contacts had the same name
and at least one of them didn't have an email.
The solution was to make `cleanTerm` consider non-sring values as
empty string, preventing the TypeError when value is `false` from
partner having no email.
opw-3439376
closesodoo/odoo#130233
X-original-commit: 2abdf7a8635ed90f0ad26c6407b21cf3c8c60fcd
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>