-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] im_livechat: fix the ajax loading on external website
Bug === The file "public_root.js" try to load "/web/webclient/locale/en_US" with ajax.loadJS we do not have the address to the Odoo server, so we try to load the file locally but this file might not exist on the website which is using the widget Fix === Overwrite ``ajax.loadJS`` and ignore ajax loading (also printing a warning message in the JS console) Task #2081146 closes #39757 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
odoo.define('web.ajax_external', function (require) { | ||
"use strict"; | ||
|
||
var ajax = require('web.ajax'); | ||
|
||
/** | ||
* This file should be used in the context of an external widget loading (e.g: live chat in a non-Odoo website) | ||
* It overrides the 'loadJS' method that is supposed to load additional scripts, based on a relative URL (e.g: '/web/webclient/locale/en_US') | ||
* As we're not in an Odoo website context, the calls will not work, and we avoid a 404 request. | ||
*/ | ||
ajax.loadJS = function (url) { | ||
console.warn('Tried to load the following script on an external website: ' + url); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters