Back-port of https://github.com/odoo/odoo/pull/130451
Adapt to 50vh instead of 95vh, as the button is quite in the middle of
the page for small heights, 95vh is still too much.
closesodoo/odoo#133193
X-original-commit: 9c3c44bcfd4bafd95428c8342abc917e0175f7e1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When we have more chat windows open than can be shown on screen, they
get hidden. When we try to open one of the hidden chat windows from the
messaging menu of the system tray, the chat window will unfold in the
hidden menu.
This commit fixes this issue by swapping the hidden chat window that is
being opened with the last visible chat window.
opw-3478264
closesodoo/odoo#133128
X-original-commit: 3649d3c0ba5a8999264b9746cfac0d9a4d1cc061
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this PR, RPC in the search GIFs 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#133125
X-original-commit: 39fe84706e02ff7828d5098c9ec56aff274cba64
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, discuss models were compared with object
reference, e.g. `thread_1 === thread_2`.
This is unsafe with `owl.reactive()`, because it wraps the objects
in a Proxy, and different proxies may map to a same raw object.
This commit fixes the issue by defining `.eq()` and `.in()` methods
on discuss models, which makes comparison on raw value rather than
proxy/reactive one.
This PR also introduce "not" variants, e.g. `.notEq()`, which eases
readability by having "not" and "eq" next to each other.
These "not" variants must be used without optional chaining,
otherwise this gives the opposite result. For example:
```js
const [t1, t2] = [Thread.insert()];
t1 === t1 // true (OK)
t1.eq(t1) // true (OK)
t1.notEq(t1) // false (OK)
t2?.notEq(t1) // undefined => falsy (notOk)
!t2?.eq(t1) // true (OK)
```
closesodoo/odoo#133065
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In preparation to further remove `afterNextRender` and other slow
waiting operations.
closesodoo/odoo#133022
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this PR, if a user copy/past an already encoded url in the composer, the
linkify function would reencode already encoded character.
`%5B%5D` (witch mean `[]`) would become `%255B%255D` because `%` whould be encoded
`%25`.
We start by decoding the url, just in case it's already encoded.
closesodoo/odoo#133010
X-original-commit: 453c91d9c5b0353b5f362ecad487ccfd547856c6
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
To avoid relying on translated attributes, add classes on specific elements that
Knowledge macros can interact with.
task-3410128
X-original-commit: 2e92fef311da5492257b275427c4dcec683b9a12
Part-of: odoo/odoo#132824
*: auth_password_policy, bus, event, im_livechat, mail, mass_mailing,
mrp_subcontracting, point_of_sale, pos_self_order, project, stock,
survey, web, web_editor, web_tour, website, website_event,
website_forum, website_sale, website_slides, base
Historically, the web.assets_common bundle was used to contain assets
that were needed by both the frontend and the backend. In practice, this
caused a bunch of issues where people would add things in assets common
that were not needed by both, and it was also abused as a way to get
bootstrap working in unrelated places by only using that bundle's css.
Because of this, as a first step, the assets_common stop being used in
the frontend, but was left everywhere else.
This commit removes the bundle completely, and moves the files that used
to be in that bundle in the other bundles that need them, this will
allow those bundles to evolve independently going forward.
in im_livechat and mail, some of the unneeded legacy code was removed, this
allows us to avoind including all of the legacy code from web in the
livechat embed bundle and in the dicuss public bundle respectively.
closesodoo/odoo#132190
Related: odoo/enterprise#45884
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this PR, jumping on a message that is not displayed in it's originThread
would not work.
To reproduce:
* star a message that is a reply.
* open the starred menu.
* Try to jump on the replied message.
This PR fix the issue by not allowing the jump.
closesodoo/odoo#132924
X-original-commit: 914f899f119e4b5f6271613b4af653211a32f915
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, most of the logos used in Odoo were using the old
purple color.
This commit updates all these old logos with the latest version that
can be found on the Odoo brand-asset page
https://www.odoo.com/page/brand-assets
task-3328677
closesodoo/odoo#132878
X-original-commit: 9e6adb74223482539fd83cb99587816969e7468b
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
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>