Skip to Content
Menu
Câu hỏi này đã bị gắn cờ
20 Lượt xem

Having problems loading a javascript function in Odoo 18.  Not sure how to access it.  It's loaded via the manifest into 'web.assets_frontend'.  In Odoo 17 it works fine.


Seems Odoo 18 encapsulates the function with some javascript?


The error I get is:

web.assets_frontend_lazy.min.js:3877 ReferenceError: removeURLParameter is not defined


Here is the code in assets_frontend_lazy.min.js:


/* /condition/static/src/js/remove_url_parameter.js */
odoo.define('@condition/js/remove_url_parameter', [], function(require) {
    'use strict';
    let __exports = {};
    function removeURLParameter(url, parameter) {
        var urlparts = url.split('?');
        if (urlparts.length >= 2) {
            var prefix = encodeURIComponent(parameter) + '=';
            var pars = urlparts[1].split(/[&;]/g);
            for (var i = pars.length; i-- > 0; ) {
                if (pars[i].lastIndexOf(prefix, 0) !== -1) {
                    pars.splice(i, 1);
                }
            }
            return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
        }
        return url;
    }
    return __exports;
});
;
Ảnh đại diện
Huỷ bỏ
Related Posts Replies Views Activity
1
thg 10 24
31
2
thg 10 24
670
0
thg 9 24
6
1
thg 6 23
730
1
thg 5 23
556