[FIX] im_livechat: Convert external_lib assets

Before this commit: some assets in im_livechat have not been converted
to the new manifest asset declaration system.

This commit converts these assets.

closes odoo/odoo#69612

X-original-commit: b6e1945a20b69dfc7cf83cd4380e92d949665093
Related: odoo/enterprise#17851
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Julien Mougenot
2021-04-21 15:49:57 +00:00
parent c20e5ad072
commit 08bb6e2e50
3 changed files with 68 additions and 70 deletions
+65 -1
View File
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
{
'name' : 'Live Chat',
'name': 'Live Chat',
'version': '1.0',
'sequence': 210,
'summary': 'Chat with your website visitors',
@@ -80,5 +80,69 @@ Help your customers with this chat, and analyse their feedback.
'im_livechat/static/src/components/discuss_sidebar/discuss_sidebar.xml',
'im_livechat/static/src/components/thread_icon/thread_icon.xml',
],
# Bundle of External Librairies of the Livechat (Odoo + required modules)
'im_livechat.external_lib': [
# Momentjs
'web/static/lib/moment/moment.js',
# Odoo minimal lib
'web/static/lib/underscore/underscore.js',
'web/static/lib/underscore.string/lib/underscore.string.js',
# jQuery
'web/static/lib/jquery/jquery.js',
'web/static/lib/jquery.ui/jquery-ui.js',
'web/static/lib/jquery/jquery.browser.js',
'web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js',
# Qweb2 lib
'web/static/lib/qweb/qweb2.js',
# Odoo JS Framework
'web/static/lib/owl/owl.js',
'web/static/src/js/promise_extension.js',
'web/static/src/js/boot.js',
'web/static/src/js/libs/download.js',
'web/static/src/js/libs/content-disposition.js',
'web/static/src/js/services/config.js',
'web/static/src/js/core/abstract_service.js',
'web/static/src/js/core/class.js',
'web/static/src/js/core/collections.js',
'web/static/src/js/core/translation.js',
'web/static/src/js/core/ajax.js',
'im_livechat/static/src/js/ajax_external.js',
'web/static/src/js/core/time.js',
'web/static/src/js/core/mixins.js',
'web/static/src/js/core/service_mixins.js',
'web/static/src/js/core/rpc.js',
'web/static/src/js/core/widget.js',
'web/static/src/js/core/registry.js',
'web/static/src/js/core/session.js',
'web/static/src/js/core/concurrency.js',
'web/static/src/js/core/utils.js',
'web/static/src/js/core/dom.js',
'web/static/src/js/core/qweb.js',
'web/static/src/js/core/bus.js',
'web/static/src/js/services/core.js',
'web/static/src/js/core/local_storage.js',
'web/static/src/js/core/ram_storage.js',
'web/static/src/js/core/abstract_storage_service.js',
'web/static/src/js/common_env.js',
'web/static/src/js/public/lazyloader.js',
'web/static/src/js/public/public_env.js',
'web/static/src/js/public/public_root.js',
'web/static/src/js/public/public_root_instance.js',
'web/static/src/js/public/public_widget.js',
'web/static/src/js/services/ajax_service.js',
'web/static/src/js/services/local_storage_service.js',
# Bus, Mail, Livechat
'bus/static/src/js/longpolling_bus.js',
'bus/static/src/js/crosstab_bus.js',
'bus/static/src/js/services/bus_service.js',
'mail/static/src/js/utils.js',
'im_livechat/static/src/legacy/public_livechat.js',
('include', 'web._assets_helpers'),
'web/static/lib/bootstrap/scss/_variables.scss',
'im_livechat/static/src/scss/im_livechat_bootstrap.scss',
'im_livechat/static/src/legacy/public_livechat.scss',
]
}
}
+3 -3
View File
@@ -16,9 +16,9 @@ class LivechatController(http.Controller):
@http.route('/im_livechat/external_lib.<any(css,js):ext>', type='http', auth='public')
def livechat_lib(self, ext, **kwargs):
# _get_asset return the bundle html code (script and link list) but we want to use the attachment content
xmlid = 'im_livechat.external_lib'
files, remains = request.env["ir.qweb"]._get_asset_content(xmlid, options=request.context)
asset = AssetsBundle(xmlid, files)
bundle = 'im_livechat.external_lib'
files, _ = request.env["ir.qweb"]._get_asset_content(bundle, options=request.context)
asset = AssetsBundle(bundle, files)
mock_attachment = getattr(asset, ext)()
if isinstance(mock_attachment, list): # suppose that CSS asset will not required to be split in pages
@@ -87,72 +87,6 @@
<script t-att-src="'%s/im_livechat/loader/%i' % (url, channel_id)" type="text/javascript"/>
</template>
<!--
Bundle of External Librairies of the Livechat (Odoo + required modules)
-->
<template id="external_lib" name="Livechat : External Librairies of the Livechat, required to make it work">
<!-- Momentjs -->
<script type="text/javascript" src="/web/static/lib/moment/moment.js"></script>
<!-- Odoo minimal lib -->
<script type="text/javascript" src="/web/static/lib/underscore/underscore.js"></script>
<script type="text/javascript" src="/web/static/lib/underscore.string/lib/underscore.string.js"></script>
<!-- jQuery -->
<script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="/web/static/lib/jquery.ui/jquery-ui.js"></script>
<script type="text/javascript" src="/web/static/lib/jquery/jquery.browser.js"></script>
<script type="text/javascript" src="/web/static/lib/jquery.ba-bbq/jquery.ba-bbq.js"></script>
<!-- Qweb2 lib -->
<script type="text/javascript" src="/web/static/lib/qweb/qweb2.js"></script>
<!-- Odoo JS Framework -->
<script type="text/javascript" src="/web/static/lib/owl/owl.js"></script>
<script type="text/javascript" src="/web/static/src/js/promise_extension.js"></script>
<script type="text/javascript" src="/web/static/src/js/boot.js"></script>
<script type="text/javascript" src="/web/static/src/js/libs/download.js"></script>
<script type="text/javascript" src="/web/static/src/js/libs/content-disposition.js"></script>
<script type="text/javascript" src="/web/static/src/js/services/config.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/abstract_service.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/class.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/collections.js"/>
<script type="text/javascript" src="/web/static/src/js/core/translation.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/ajax.js"></script>
<script type="text/javascript" src="/im_livechat/static/src/js/ajax_external.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/time.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/mixins.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/service_mixins.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/rpc.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/widget.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/registry.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/session.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/concurrency.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/utils.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/dom.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/qweb.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/bus.js"></script>
<script type="text/javascript" src="/web/static/src/js/services/core.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/local_storage.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/ram_storage.js"></script>
<script type="text/javascript" src="/web/static/src/js/core/abstract_storage_service.js"></script>
<script type="text/javascript" src="/web/static/src/js/common_env.js"></script>
<script type="text/javascript" src="/web/static/src/js/public/lazyloader.js"/>
<script type="text/javascript" src="/web/static/src/js/public/public_env.js"/>
<script type="text/javascript" src="/web/static/src/js/public/public_root.js"/>
<script type="text/javascript" src="/web/static/src/js/public/public_root_instance.js"/>
<script type="text/javascript" src="/web/static/src/js/public/public_widget.js"/>
<script type="text/javascript" src="/web/static/src/js/services/ajax_service.js"></script>
<script type="text/javascript" src="/web/static/src/js/services/local_storage_service.js"></script>
<!-- Bus, Mail, Livechat -->
<script type="text/javascript" src="/bus/static/src/js/longpolling_bus.js"></script>
<script type="text/javascript" src="/bus/static/src/js/crosstab_bus.js"></script>
<script type="text/javascript" src="/bus/static/src/js/services/bus_service.js"></script>
<script type="text/javascript" src="/mail/static/src/js/utils.js"></script>
<script type="text/javascript" src="/im_livechat/static/src/legacy/public_livechat.js"></script>
<t t-call="web._assets_helpers"/>
<link rel="stylesheet" type="text/scss" href="/web/static/lib/bootstrap/scss/_variables.scss"/>
<link rel="stylesheet" type="text/scss" href="/im_livechat/static/src/scss/im_livechat_bootstrap.scss"/>
<link rel="stylesheet" type="text/scss" href="/im_livechat/static/src/legacy/public_livechat.scss"/>
</template>
<!-- the js code to initialize the LiveSupport object -->
<template id="loader" name="Livechat : Javascript appending the livechat button">
<t t-translation="off">