Commit Graph
115 Commits
Author SHA1 Message Date
Zelong Lin d57c64f95b [IMP] mail, *: remove 'public' field in channel
*: im_livechat, website_livechat

Access right should be based on channel type and membership instead.
Chat always private, group always private, channel private should
disapear and be a group instead (migration needed), and other channel
always public (but they can still be further restricted with
the "allowed groups" feature)

task-2632861

closes odoo/odoo#90415

Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-09-06 10:57:59 +02:00
xO-Tx d7a5a06c68 [REF] website, *: use OWL views for new content
*: website_blog, website_event, website_forum, website_livechat,
website_sale, website_sale_slides, website_slides, website_slides_forum

The goal of this commit is to adapt the website "new content" form
views to OWL.

Follows the merge of the "website in backend" task at [1].

[1]: 31cc10b91d

task-2687506

Part-of: odoo/odoo#96346
2022-09-04 14:39:44 +02:00
Alexandre Kühn aecdc50278 [IMP] im_livechat, *: Refactor JS Public Livechat (step 16)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2965839

closes odoo/odoo#99137

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-30 02:51:08 +02:00
Alexandre Kühn c0532b6aec [IMP] im_livechat, *: Refactor JS Public Livechat (step 15)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2963842

closes odoo/odoo#98987

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-27 03:33:58 +02:00
Alexandre Kühn 357b4437f7 [FIX] website_livechat: introduce Visitor/serverCountry
Fixes a traceback due to Visitor/country being a computed field
that is imperatively updated by server data.

Task-2962126

closes odoo/odoo#98847

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:17 +02:00
Alexandre Kühn 34c88157a6 [IMP] im_livechat, *: Refactor JS Public Livechat (step 14)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2961782

closes odoo/odoo#98798

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-25 04:21:01 +02:00
Matthieu Stockbauer fe699a241d [IMP] *: adapt client code to use websocket instead of longpolling
*: bus, calendar, hr_attendance, iap_mail, im_livechat, project, snailmail,
snailmail_account, survey, web, web_editor, website_livechat.

This commit is part of the websocket integration in Odoo.
This bus service now communicates with a shared worker in order to provide
a single websocket connection for multiple tabs. It is designed to
be used as a websocket except that events are slightly different,
re-connection is handled automatically. If the browser does not support shared
worker (Safari), the service fallback on a simple web worker.

Available events are:
   - connect : fired upon a successful connection.
   - disconnect : fired upon reception of the websocket close event.
     The close code and reason are given to the listeners callback.
   - reconnect : fired upon a successful re-connection.
   - reconnecting : triggered when the worker starts to try reconnecting.
   - notification : fired upon the reception of notifications.

Since multiple tabs are now handled by a worker, the cross_tab bus is no longer
required and has been removed.

Part-of: odoo/odoo#75510
2022-08-23 17:55:10 +02:00
Sébastien Theys 34d775e873 [IMP] mail, *: remove explicit usage of insert-and-replace
* = calendar, im_livechat, rating, snailmail, test_discuss_full, test_mail,
    website_livechat

Distinction between "replace" and "insert-and-replace" can be guessed based on
the type of the provided data.

task-2957295

closes odoo/odoo#98404

Related: odoo/enterprise#30580
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-19 11:53:05 +02:00
Louis Wicket (wil) 5d43fad9e6 [IMP] mail, *: auto add implicit attributes of identifying fields
Automatically add `required` and `readonly` on identifying fields and
remove them from field definition.

Task-2955910.
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

closes odoo/odoo#98283

Related: odoo/enterprise#30511
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:53 +02:00
Rahul Prajapati 4123505efa [IMP] *: have replace as default command on update
* im_livechat, mail, snailmail, website_livechat

PURPOSE:

A `replace` command should be default while updating a field.

SPECIFICATION:

- If no command is passed while updating a field, add a `replace` command as
default.
- Remove all the existing occurrences of `replace` command.

Task-2851488

closes odoo/odoo#95885

Related: odoo/enterprise#30494
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-17 19:48:11 +02:00
Sébastien Theys 60c87dd426 [IMP] mail, *: introduce identifyingMode and remove identifyingFields
* = calendar, hr, im_livechat, rating, snailmail, website_livechat

This simplifies definition and overrides and opens up new identification
opportunities.

Part of task-2741982

closes odoo/odoo#98166

Related: odoo/enterprise#30470
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-08-17 11:21:40 +02:00
Alexandre Kühn f2d3a5bbd4 [IMP] im_livechat, *: remove Promise.reject in LivechatButton
*: website_livechat

closes odoo/odoo#98160

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-16 17:50:03 +02:00
tsm-odoo 75007b578e [MOV] bus, *: move startServer test helper to the bus module
*: calendar, hr, hr_holidays, im_livechat, note, rating, snailmail,
test_mail, test_mail_full, website_livechat, website_slides.

Part-of: odoo/odoo#97771
2022-08-10 14:43:41 +02:00
Alexandre Kühn b7b4161873 [IMP] im_livechat, *: Refactor JS Public Livechat (step 13)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2943607

closes odoo/odoo#97403

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-03 19:33:53 +02:00
Alexandre Kühn 3bceb9159b [IMP] im_livechat, *: Refactor JS Public Livechat (step 12)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2942001

closes odoo/odoo#97354

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-03 06:34:21 +02:00
Alexandre Kühn 6c7f178bdc [IMP] im_livechat, *: Refactor JS Public Livechat (step 11)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2939083

closes odoo/odoo#97219

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-01 18:21:00 +02:00
Alexandre Kühn 86167977ea [IMP] im_livechat, *: Refactor JS Public Livechat (step 10)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2937174

closes odoo/odoo#97030

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-29 01:51:07 +02:00
Alexandre Kühn d27546064a [IMP] im_livechat, *: Refactor JS Public Livechat (step 9)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2928837

closes odoo/odoo#96690

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-07-28 02:40:06 +02:00
Sébastien Theys 28200c5ad5 [IMP] mail, web: adapt chatter container in new form
task-2871070

Part-of: odoo/odoo#78221
2022-07-22 16:21:45 +02:00
Alexandre Kühn 8840b37989 [IMP] im_livechat, *: Refactor JS Public Livechat (step 8)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2925850

Part-of: odoo/odoo#96447
2022-07-21 01:53:32 +02:00
Louis Wicket (wil) fdcaa53ca0 [IMP] mail, *: rename mail.channel.partner to mail.channel.member
* = calendar, crm_livechat, hr_holidays, im_livechat, privacy_lookup,
privacy_lookup, test_discuss_full, test_mail_full, website_livechat

closes odoo/odoo#95912

Related: odoo/upgrade#3681
Related: odoo/enterprise#29433
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-07-19 11:50:37 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Alexandre Kühn 21471fc5e7 [IMP] im_livechat, *: Refactor JS Public Livechat (step 7)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2898692

closes odoo/odoo#94914

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-30 12:11:00 +02:00
tsm-odoo 91cb9002dc [IMP] mail, *: remove deprecated autoOpenDiscuss parameter
*: im_livechat, website_livechat.

The autoOpenDiscuss parameter was used but is deprecated for a while now.
This PR removes it.

closes odoo/odoo#94716

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-28 14:06:06 +02:00
Alexandre Kühn 5206b66aed [MOV] im_livechat, *: Refactor JS Public Livechat (step 6)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2896237

closes odoo/odoo#94722

Related: odoo/enterprise#28913
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-28 00:36:42 +02:00
Alexandre Kühn 67e35f45a4 [IMP] im_livechat, *: Refactor JS Public Livechat (step 6)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2896237

Part-of: odoo/odoo#94722
2022-06-28 00:36:42 +02:00
31cc10b91d [MERGE] website, *: move the frontend UI to the backend
*: auth_signup, knowledge, mass_mailing, portal, survey, test_website,
   test_website_modules, test_website_slides_full, web, web_editor,
   web_tour, web_unsplash, website_blog, website_crm,
   website_crm_partner_assign, website_customer, website_event,
   website_event_exhibitor, website_event_meet, website_event_track,
   website_forum, website_hr_recruitment, website_knowledge,
   website_links, website_livechat, website_mail_group,
   website_mass_mailing, website_membership, website_sale,
   website_sale_autocomplete, website_sale_comparison,
   website_sale_loyalty, website_sale_slides, website_sale_wishlist,
   website_slides, website_slides_forum, website_twitter, base

A new client action is introduced, to display the website in an iframe.
This allows to remove the "frontend" Odoo UI entirely. Everything
related to the website configuration (and especially the edit mode) will
now be done on the backend side.

The idea behind this mainly comes from the fact that we needed the
website in an iframe during edition to be able to render a mobile
preview properly. It was also required so that options which reloads
the page... are able to only reload the page and not the entire editor
with it. From there, it was decided that actually, since the website is
in an iframe, it could be in the backend and every website UI could
rely on this.

In the end, this comes with many functional and technical advantages.
Here are some of them (a few of them are not entirely done with this
merge but will follow the merge in the upcoming weeks, see this as a
non-exhaustive list of possibilities that are unlocked by this work):

Technical:

- No duplicated logic for website UI and backend (purple navbar is the
  backend one, slightly customized).
- No conflicting logic for website UI and website content (like dialog
  opening, ...).
- No forced CSS for our website / web_editor UI, no conflict with
  website themes.
- Everything converted in OWL, in backend code (no special OWL for
  frontend).
- "Legacy" code moved as frontend code or removed.
- No website content CSS for the case "when there is the Odoo purple
  navbar at the top".
- Backend views & features available (e.g. creating a new event -> form
  view instead of custom code with onchanges, validations, etc)

Functional:

- All website features available while editing your website (product
  configuration, settings, etc), no switch backend/frontend, no
  redirection, no reload (just the iframe).
- All other app features available while editing your website (discuss,
  calendar, all other apps, ...).
- Typing a website URL in your browser reaches your website (very small
  Odoo UI overlay at the top left as a connected user).
- Mobile preview: directly resizing the website rendering, in edit mode
  too and with a better phone image.
- Editor: mobile view edition (the editor is instanciated around the
  website content instead of inside of it (iframe))
- Can reload the website without reloading all the tools (editor, html
  editor, menu edition, etc) (customize_show options for instance ->
  moved as standard editor options which reloads the website only)
- Website UI in your language instead of website language

On the backend side, some customizations were done so that the UI feels
like it works as before (note that it will be reworked in upcoming weeks):

- A `website_systray` registry is defined to replace the systray items
  with the website's one when previewing the website.
- The webclient's navbar is patched to display additional dropdown menus
  related to the website edition.
- A website service that holds the global state of the website is
  introduced. Components from the systray and the dropdown menus can
  access and modify it.
- A component adapter for the wysiwyg (that will display the snippets
  menu) is added, that allows for caching the wysiwyg libraries, thus
  improving editions responsiveness.

See sub-commits for details. This work is known to not be bug-free and
will be bug-fixed, improved and reworked in the upcoming weeks.

task-2687506

Thanks to the whole team for reviewing and testing !
(ARD, BVR, BSO, GDI, MOU, PDE, QSM, RDE, SOBO, YOL)

closes odoo/odoo#89223

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: Arthur Detroux <ard@odoo.com>
Co-authored-by: Mehdi Outagant <mou@odoo.com>
Co-authored-by: Benjamin Vray <bvr@odoo.com>
2022-06-24 12:39:14 +02:00
Arthur Detroux (ard) 03c552690b [IMP] website, *: adapt code so that it may work with an external editor
*: mass_mailing, web, web_editor, website_blog, website_event,
   website_event_meet, website_livechat, website_sale, website_twitter,
   base

This commit does 3 things:

- Adapt existing code so that the editor can be run outside of its
  editing element. Prior to this commit, it was expected that the
  editor would be attached to the element it was currently editing.
  This needs to change however as the editable is now inside an
  iframe for the website edition. mass_mailing already had a similar
  approach but the editor was started within the iframe.
  With these changes, the editor is alongside the iframe, editing
  the content that's inside it. This allows multiple features
  such as reloading the iframe while keeping the editor visible and
  resizing the iframe for a mobile preview.

- Adds logic to the wysiwyg_adapter so that it can undertake
  the duty of the previous widget sytem. The wysiwyg existed not only
  in the legacy widget system, but most importantly in the frontend.
  One of the duties of this adapter is to send events inside the
  iframe when it is necessary to reach the frontend public widget
  (i.e. widgets_start_request)

- Removes existing SCSS that is no longer used.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx 8925df7e75 [IMP] website, *: add new content dialogs
*: website_blog, website_event, website_forum, website_livechat,
   website_sale, website_sale_slides, website_slides,
   website_slides_forum

The goal of this commit is to add dialogs to create new website content
using a 'target:new' action on the form view and an overridable
"website" form controller.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier ca2e143d54 [IMP] website, *: add new content systray item
*: website_blog, website_event, website_forum, website_hr_recruitment,
   website_livechat, website_sale, website_slides

The NewContentModal component is added. It displays tiles, which will
install a module if not already installed, or perform an action defined
by the module otherwise. So that modules can patch that component to
define an action when installed (for example, website_sale will handle
the logic of creating a new product), the elements to displayed and
their state (NOT_INSTALLED, INSTALLING, INSTALLED) are listed in the
state of the component.

A key 'isDisplayed' is added on the new content elements that should not
be displayed to the user, depended on his security groups.
By default, the new content elements are displayed to the system user.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
qsm-odoo 29f21a23f1 [MOV] website, *: move static files to prepare website UI in backend
*: web_editor, web_unsplash, website_event, website_blog,
   website_event_meet, website_forum, website_links, website_livechat,
   website_sale_slides, website_slides

With [1], many files will move as the website UI is moved in the
backend. This commit moves all the static files (JS/CSS/XML) to their
final destination without modifying them, in an attempt to preserve
some history and ease some forward-ports.
After this commit, everything works as before as the files are simply
renamed and the references to them adapted.

However, technically, many files will actually be split into multiple
files by the work made with [1]. While it is theoretically possible to
preserve history over multiples files, this would require inner merge
commits, which does not go well with robodoo. In those cases, the "main"
file of the split was chosen. Mainly, 4 worth-noticing splits were
detected (and so the history moved only to the first file):

move: addons/web_editor/static/src/js/wysiwyg/widgets/media.js
to: addons/web_editor/static/src/components/media_dialog/file_selector.js
  - addons/web_editor/static/src/components/media_dialog/search_media.js
  - addons/web_editor/static/src/components/media_dialog/image_selector.js
  - addons/web_editor/static/src/components/media_dialog/document_selector.js
  - addons/web_editor/static/src/components/media_dialog/icon_selector.js
  - addons/web_editor/static/src/components/media_dialog/video_selector.js

move: addons/web_editor/static/src/js/wysiwyg/widgets/upload_progress_toast.js
to: addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js
  - addons/web_editor/static/src/components/upload_progress_toast/upload_service.js

move: addons/website/static/src/js/menu/content.js
to: addons/website/static/src/components/dialog/edit_menu.js
  - addons/website/static/src/components/dialog/page_properties.js
  - addons/website/static/src/components/wysiwyg_adapter/page_options.js
  - addons/website/static/src/js/website_page_list.js

move: addons/website/static/src/js/menu/edit.js
to: addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js
  - addons/website/static/src/systray_items/edit_website.js
  - addons/website/static/src/components/editor/editor.js

Notice that as those moves were made post-work and the rest of the work
(80+ commits) rebased on top of it, some commits may remove more than
they should in a moved file to then reimplement some of what was
removed in a later commit... ideally this should have been avoided of
course but keep in mind that the final files are just entirely rewritten
and split as converted to OWL. It seemed however worth it to keep most
of the inner history of the work made here to see step by step what was
done. [1] will obviously be merged with a merge commit, binding the
whole work together.

[1]: https://github.com/odoo/odoo/pull/89223

task-2687506
2022-06-24 10:28:04 +02:00
Alexandre Kühn c27de6c738 [IMP] im_livechat, *: Refactor JS Public Livechat (step 5)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2894102

closes odoo/odoo#94508

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-24 09:26:08 +02:00
Alexandre Kühn 69cb3a2562 [IMP] im_livechat, *: Refactor JS Public Livechat (step 3)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2890189

closes odoo/odoo#94190

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-22 02:15:51 +02:00
Alexandre Kühn da8e5f2489 [IMP] im_livechat, *: Refactor JS Public Livechat (step 2)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2888734

closes odoo/odoo#94090

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 19:48:54 +02:00
Rahul Prajapati 71a68c5923 [IMP] *: remove support for empty create with pyenv
* hr, im_livechat, mail, sms, snailmail, test_mail_full, website_livechat,
  website_slides

PURPOSE:

Creating a record with no values has no sense but is sometimes useful during
tests.
The support should be dropped for `default` parameter in `create`.

SPECIFICATION:

All the occurrences of `create()` have been replaced by `create({})`.

Task-2869394

closes odoo/odoo#93917

Related: odoo/enterprise#28538
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-20 15:31:51 +02:00
Alexandre Kühn 1e72215353 [IMP] im_livechat, *: Refactor JS Public Livechat (step 1)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2887296

closes odoo/odoo#93966

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-17 21:37:35 +02:00
Alexandre Kühn 190feb8d6d [IMP] im_livechat, *: make JS models available in livechat external lib
This commit make messaging service available in the frontend and in
the livechat external lib bundle.

This is preparation to refactoring JS livechat to use models and OWL.

*: bus, mail, survey, web, website_livechat

Task-2870899

closes odoo/odoo#92786

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-13 16:51:27 +02:00
tsm-odoo 3573a7fef4 [IMP] mail, *: use wowlEnv instead of the legacy one
*: bus, calendar, hr, hr_holidays, im_livechat, mail, mail_bot, note, project,
sms, snailmail, test_mail, web, website_livechat, website_slides.

task-2582313

closes odoo/odoo#83774

Related: odoo/enterprise#26493
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-30 19:40:53 +02:00
Nemael 6f90029a12 [MOV] im_livechat: turn legacy livechat into odoo modules
Task-2825098

closes odoo/odoo#90842

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-05-25 12:45:55 +02:00
Aurélien Warnon 5a4521b70b [FIX] website_livechat: fix chatbot tour nondeterministic issue
Followup of: 623fdb15ce9a6f3f586254dca549a72869336729

The previous attempt at fixing the tour issue was non-conclusive as it still
breaks occasionally during runbot nightly builds.

That issue is near-impossible to properly debug, because it *only* happens
during nightly builds (cannot be reproduced locally and cannot be reproduced
with a multi-build configuration on the runbot).

We decided instead to slightly modify the tour step to click on the
"restart button" from the end of the conversation instead of the restart button
from the chat window header.

This should hopefully do the trick.

closes odoo/odoo#91656

X-original-commit: 50044dc7f547e2fcd7416f725987236b6185e6d6
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-18 16:05:00 +02:00
Aurélien Warnon babc6ff819 [FIX] website_livechat: fix chatbot tour race condition
In some cases, the runbot running the tour was clicking on the
"restart conversation" button before we had the chance to register the click
event on it.

This small commit adds a "ready" class on the button when we have correctly
registered the click event, and makes the tour step wait for that class before
clicking to restart.

closes odoo/odoo#91505

X-original-commit: 623fdb15ce9a6f3f586254dca549a72869336729
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-05-16 20:18:27 +02:00
tsm-odoo 6c8fbd0da1 [IMP] mail, *: add sendmany/sendone to the mock server
*: im_livechat, website_livechat.

In order to reduce the noise in the PR introducing the new environment in
the discuss app, calls to widget.call, env.bus_service.call during tests
have been replaced by a mocked implementation of _sendone/_sendmany. Moreover,
this approach will allow us to mock the longpolling during tests, resulting in
a more realistic behavior.

task-2582313

closes odoo/odoo#90724

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-13 18:10:56 +02:00
tsm-odoo c23f85903a [IMP] mail, *: use pyEnv in the mockServer
Now that pyEnv is available, using it in the mock_server lighten the syntax.

task-2582313

closes odoo/odoo#90783

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-13 11:59:58 +02:00
Alexandre Kühn da40fedde0 [IMP] mail, *: pass record instead of local id in props
*: hr_holidays, im_livechat, snailmail, website_livechat

Task-2847927

closes odoo/odoo#90882

Related: odoo/enterprise#27110
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-09 20:58:31 +02:00
tsm-odoo 7e5a71ab71 [IMP] mail, *: always mount discuss/chatWindow/dialog during tests
*: hr, im_livechat, snailmail, website_livechat.

This PR prepares the ground for  the one introducing the new environment in the
discuss app. Indeed, tests will now use the mainComponentRegistry in order to mount
those components. Doing so, the parameters has{Discuss/Dialog/ChatWindow} will become
obsolete. Removing those parameters now helps reducing the noise in the main PR.

task-2582313

closes odoo/odoo#90120

Related: odoo/enterprise#26759
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-05-03 13:31:08 +02:00
Alexandre Kühn 3a8b0ee923 [IMP] mail, *: replace link commands to replace
*: hr, hr_holidays, im_livechat, website_livechat

This commit turns some `link`/`unlink`/`unlinkAll` to `replace`/`clear`.
The commands `replace`/`clear` are easier to understand, and also clearly tells what’s the expected resulting value of this field.

This change will help turning big and imperative code into smaller declarative code.

Task-2834598

closes odoo/odoo#89852

Related: odoo/enterprise#26673
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-29 19:23:49 +02:00
tsm-odoo 96288beeb6 [IMP] mail, *: prepare mockServers for wowlEnv
*: calendar, hr_holidays, im_livechat, note, website_livechat.

This PR helps reducing the noise in the discuss new env PR. Indeed,
the new mockServer has the same method except that they are not prefixed
by any underscore. All calls have been changed, and the corresponding
methods created. They will be deleted later.

task-2582313

closes odoo/odoo#89659

Related: odoo/enterprise#26603
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-27 10:04:17 +02:00
Alexandre KühnandSébastien Theys d81c77234d [IMP] mail, *: tests: use mail.channel.partner for seen indicator
* = hr_holidays, im_livechat, website_livechat

Task-2810539

closes odoo/odoo#87587

Related: odoo/enterprise#25911
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2022-04-15 15:28:49 +02:00
Nemael 3b87a36683 [IMP] im_livechat: split public_livechat.js into many files
Follow-up of: https://github.com/odoo/odoo/pull/87597

This is the 2nd and final step of splitting public_livechat.js
into several files.

This is part of refactoring public livechat so that it uses
essentially the same codebase as discuss in the web client.

Splitting in smaller files helps following steps to refactor
the code.

Task-2818675
Part of Task-2212347

closes odoo/odoo#88654

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-15 12:30:45 +02:00
Ipsita Borisagar 4568ac681a [FIX] website_livechat: visitor info should be below topbar
Before this commit:

In discuss, livechat website visitor info is displayed above thread view topbar.

After this commit:

Livechat website visitor info will be displayed below the thread view topbar.

Task-2668036

closes odoo/odoo#88532

X-original-commit: 5294def72da677c75f980ffcfb1bb50508ee0760
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-12 13:48:09 +02:00