简体   繁体   English

Odoo v15 LiveChat 应用程序无法正确加载

[英]Odoo v15 LiveChat App will not load properly

I have a website built on Odoo v15 Enterprise Edition (SaaS, hosted by Odoo) and I would like to activate the LiveChat feature of the website.我有一个基于 Odoo v15 企业版(SaaS,由 Odoo 托管)构建的网站,我想激活该网站的 LiveChat 功能。 I created a sandbox to work in so I do not affect the live website.我创建了一个沙箱来工作,所以我不会影响实时网站。

I followed the instructions from the Odoo Documentation and did the following:我按照 Odoo 文档中的说明执行了以下操作:

  1. Opened the LiveChat channel (LiveChat App > Channels) and added myself as an Operator.打开 LiveChat 频道(LiveChat 应用 > 频道)并将我自己添加为操作员。
  2. Copied the code snippet from the "Widget" tab (inside the LiveChat channel) and pasted it into the <head> of my website.从“Widget”选项卡(在 LiveChat 频道内)复制代码片段并将其粘贴到我网站的<head>中。
  3. Clicked on the "Go To Website" button in the top right corner of the LiveChat Channel, and then clicked on the "Unpublished" button at the top right of the screen (which changed to "Published".)单击 LiveChat 频道右上角的“转到网站”按钮,然后单击屏幕右上角的“未发布”按钮(已更改为“已发布”)。
  4. Went into the "Settings" (Settings > Website > Features > Live Chat) and chose the channel from the dropdown.进入“设置”(设置 > 网站 > 功能 > 实时聊天)并从下拉列表中选择频道。

When I go to the homepage of my website I do not see a chat button and when I open the Console in Developer Tools (Chrome browser) I see these error messages:当我 go 到我网站的主页时,我没有看到聊天按钮,当我在开发人员工具(Chrome 浏览器)中打开控制台时,我看到以下错误消息:

实时聊天错误

Plain Text:纯文本:

web.assets_common_minimal.min.js:85 warning: Some modules could not be started

web.assets_common_minimal.min.js:85 Missing dependencies:     (3) ['web.Session', 'root.widget', 'im_livechat.legacy.im_livechat.im_livechat']

web.assets_common_minimal.min.js:90 Non loaded modules:       (2) ['web.session', 'im_livechat.livesupport']

web.assets_common_minimal.min.js:91 Debug:                    {web.session: {…}, im_livechat.livesupport: {…}}

web.assets_common_minimal.min.js:78 Uncaught Error: Service web.session already defined
    at odoo.define (web.assets_common_minimal.min.js:78:29)
    at web.assets_frontend_lazy.min.js:1594:6

It looks like web.session has already been defined.看起来web.session已经被定义了。 When I located the.xml file that contained the code for this ( im_livechat.loader ), I found it contained the following:当我找到包含此代码 ( im_livechat.loader ) 的 .xml 文件时,我发现它包含以下内容:

<t t-if="web_session_required">
                  odoo.define('web.session', function (require) {
                      var Session = require('web.Session');
                      var modules = odoo._modules;
                      return new Session(undefined, "<t t-esc="info['server_url']"/>", {modules:modules, use_cors: true});
                  });
                </t>

Just to see what would happen, I commented out this section of the im_livechat.loader file and reloaded the homepage.只是为了看看会发生什么,我注释掉了im_livechat.loader文件的这一部分并重新加载了主页。 The button was now visible, but was clearly not showing up the way it should be:该按钮现在可见,但显然没有按应有的方式显示:

在此处输入图像描述

I also saw an error pop up (URL has been removed):我还看到一个错误弹出(URL 已被删除):

UncaughtPromiseError > TypeError
Uncaught Promise > Cannot read properties of undefined (reading 'bus_service')
TypeError: Cannot read properties of undefined (reading 'bus_service')
    at ComponentAdapter._trigger_up (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:1565:32)
    at Class._trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:462)
    at Class._trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:462)
    at Class.trigger_up (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4728:280)
    at Class.call (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4781:372)
    at Class.start (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:2264:6)
    at prototype.<computed> (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4581:488)
    at Class.start (https://***/web/assets/499024-5bf19f0/1/web.assets_frontend_lazy.min.js:2346:77)
    at Class.start (https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4584:371)
    at https://***/web/assets/499021-d833d51/1/web.assets_common_lazy.min.js:4929:52

When I check the Console in Developer Tools I see this error:当我在开发人员工具中检查控制台时,我看到了这个错误:

在线聊天错误 2

Plain Text:纯文本:

web.assets_frontend_lazy.min.js:1565 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bus_service')
    at ComponentAdapter._trigger_up (web.assets_frontend_lazy.min.js:1565:32)
    at Class._trigger_up (web.assets_common_lazy.min.js:4728:462)
    at Class._trigger_up (web.assets_common_lazy.min.js:4728:462)
    at Class.trigger_up (web.assets_common_lazy.min.js:4728:280)
    at Class.call (web.assets_common_lazy.min.js:4781:372)
    at Class.start (web.assets_frontend_lazy.min.js:2264:6)
    at prototype.<computed> (web.assets_common_lazy.min.js:4581:488)
    at Class.start (web.assets_frontend_lazy.min.js:2346:77)
    at Class.start (web.assets_common_lazy.min.js:4584:371)
    at web.assets_common_lazy.min.js:4929:52

Can anyone point me in the right direction?谁能指出我正确的方向? Any help would be greatly appreciated.任何帮助将不胜感激。

Thank you!谢谢!

We did end up solving this issue.我们确实最终解决了这个问题。

Apparently there was an older view (named "Livechat: include loader on Website") which was deactivated, but still causing issues with the way the code for the chat button was being loaded.显然有一个旧视图(名为“Livechat:在网站上包含加载程序”)已被停用,但仍然导致聊天按钮代码的加载方式出现问题。 We think it was an older view from a previous version of Odoo (we are currently running v15.)我们认为这是旧版 Odoo 的旧视图(我们目前运行的是 v15。)

After deleting the deactivated view the chat window began showing up correctly and everything worked as expected.删除停用视图后,聊天 window 开始正确显示,一切都按预期进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM