* = 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>
* = 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
*: 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>
This commit removes the legacy service classes:
- AbstractService
- AjaxService
- AbstractStorageService
- LocalStorageService,
- SessionStorageService
Only AjaxService was still used as a service so it is moves in the
"common_env" file.
task 3439226
closesodoo/odoo#131683
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit fixes an issue in the demo data leading
to a crash when consulting the ratings on the website.
Steps to reproduce:
- Go to livechat channel form
- Click on "Go to website"
- Error 500
closesodoo/odoo#131640
X-original-commit: 04b6831816425592b9ab9077c6d0caf20b95c93e
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Before this PR, scrollbar in livechat session history was horizontal because the
flex-flow was set to column.
This PR remove the flex-flow to fix the issue.
task-3383919
closesodoo/odoo#131611
X-original-commit: ac3275706bbc3fcc1bffea731973de850db74892
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@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
*: 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>
Before this commit, calls to record[fieldname][value/raw_value] in
the arch of a kanban view did not take into account updates on the Record
Datapoint. So if any data in the Record changed, the [raw_value/value]
was not modified.
In a custom KanbanRecord, you should never use the record containing the
value and raw_value. We will therefore replace this call by using the
datapoint record directly.
How to reproduce:
- Have a kanban view with a record.my_field.value and a widget allowing
you to modify the value of my_field.
- Click on the widget
Before this commit:
The value of my_field does not change
After this commit:
The value of my_field has been updated.
closesodoo/odoo#131165
Related: odoo/enterprise#45413
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this commit, the fold state, seen message id and message unread counter
was never saved on the livechat session state. This is due to an incorrect check
on the session state. We wan't to ensure the session is not closed when writing
such information but the state was checked on the thread instead of the livechat
service.
closesodoo/odoo#131049
X-original-commit: a81208d980a2a30bcff6382729e2ed8369e6a65d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@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>
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
*: 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>
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>
Both language and country are displayed in the channel member list. Before this
commit, this was displayed in one line when available which looked bad. This
commit allow those items to wrap for a better display.
closesodoo/odoo#130220
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: bus, crm_livechat, crm_mail_plugin, im_livechat, payment, payment_demo,
pos_online_payment, test_discuss_full, test_mail_full, tests, website_livechat,
website_sale.
Several python tests have their own way to make jsonrpc requests. This PR adds a
generic `make_jsonrpc_request` method to the `HttpCase` in order to provide a
generic way to do so.
At the same time, calls to `_open_livechat_channel` are removed in favor of
jsonrpc request to `get_session`. This makes the tests more realistics (some
incoherences were present like passing `country_id` to the open channel method
while the user country id is not set...)
Finally, this will ease the diff in the PR introducing livechat visitors as mail
guests.
part of task-3332628
closesodoo/odoo#130036
Related: odoo/enterprise#44840
Signed-off-by: Sébastien Theys (seb) <seb@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>
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>
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 PR, failing to persist a livechat thread would
stuck the livechat session in an incoherent state, preventing
the user to open a livechat. This PR ensures the thread service
does not write anything if there is no session.
closesodoo/odoo#129699
X-original-commit: d4e8b62fa8f008cd4ab7d69e413115cb35a6ac33
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Since [1], the `mail.assets_emoji` bundle is located in
the web module and is named `web.assets_emoji`. This rename
was done without taking into account the `get_emoji_bundle`
route used by the livechat module.
This PR fixes this issue.
[1]: https://github.com/odoo/odoo/pull/125137closesodoo/odoo#129661
X-original-commit: 75b18d35a84ad770c559ff0585cc4b9485399134
Signed-off-by: Didier Debondt (did) <did@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.
Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”
The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.
closesodoo/odoo#129468
X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
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>
Only two thread actions are allowed for the embed livechat
for now: closing the chat window and folding it. Until now,
the actions were not loaded but this is dependent of the
imported files which is not ideal.
This PR makes allowed thread actions explicit in order to
ensure only the right thread actions are available.
closesodoo/odoo#129090
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit the `mail.shortcut` search view was
only available when installing `website_livechat_helpdesk`.
This search view focuses on classical `mail.shortcut` field
and could be used accross the different modules that use
this view.
This commit moves the search view to the mail module in order
to do so.
closesodoo/odoo#128120
Related: odoo/enterprise#43976
Related: odoo/upgrade#4925
Signed-off-by: Sébastien Theys (seb) <seb@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>
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
Since [1], the discuss notification handler is no longer
in the core folder. Due to this change, the livechat was
not processing the bus notifications anymore. This PR fixes
this issue.
[1]: https://github.com/odoo/odoo/pull/128593closesodoo/odoo#128849
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Translate Welcome Bot's messages according to the language of the
frontend.
closesodoo/odoo#128745
X-original-commit: 68fca3cc6a62adf418c516f28a6b29e235475b5f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Before this commit, a crash occurred when the user changed after
starting a livechat conversation.
Steps to reproduce (login => logout)
- Login on admin
- Go to the website
- Start a livechat conversation
- Logout
- Start typing on the chat window composer
- Crash due to `NotFound` raised after `notify_typing`
The same error could occur the other way around (logout => login).
This error is due to the user not being a channel member after it
changed.
In order to fix this issue, livechat session is cleared when the
user changes. Indeed, it the "new" user is not linked to the livechat
conversation so it makes no sense to display it.
fixes https://github.com/odoo/odoo/issues/128206
opw-3421386
closesodoo/odoo#128595
X-original-commit: 3cea3878911831eee5abee9272c7b81145ee7128
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, inviting a channel member to a livechat channel
would change its name. This is not what we want as the thread name
should always be the one of the visitor (e.g. "Visitor 20", task-3332872).
Steps to reproduce:
- Open two tabs, one with admin log, one on the support page
- Click on the livechat button and send a message from the support page
- Invite a member with the admin tab
- The name of the thread changed.
closesodoo/odoo#128238
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, the lang of the visitor was only shown on the
member list based on the `anonymous_country` of the channel.
In order for this information to be as complete as possible, the
lang is now also checked on the website visitor if there is one.
part of task-3332872
closesodoo/odoo#128242
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, inviting a partner to a livechat channel
had no effect. This commit solves this issue.
Steps to reproduce:
- Go to a livechat channel in the discuss app
- Click on invite a member on the top right corner
- Select a member
- Click on the invite button
- Nothing happens
closesodoo/odoo#128173
X-original-commit: 94086d9289222008f59a97611a80de4e1310e41c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Change "attendees" by "participant(s)" the discuss channel "session history"
views in the livechat module.
part of task-3332872
closesodoo/odoo#128239
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>