How to override js function in odoo

2019-07-18 15:54发布

问题:

I want to load /shop/checkout url. function is :

odoo.define('change_info_order.website_sale_change_info_order', function (require) {
    "use strict";

    $('.oe_website_sale').each(function () {
        var oe_website_sale = this;

        $(oe_website_sale).on('click', 'a.js_checkout_btn', function (ev) {
            var e = document.getElementById("js_customer_change");
            // var customer_id = e.options[e.selectedIndex].value;
            var customer_id = **e.value**;
            if (customer_id) {
                window.location.href = '/shop/checkout';
            }
            else {
                Dialog.alert(self, _t("Please select the customer"));
            };
        });

    });
});

My inherit code is:

odoo.define('website_sale_product_list.website_sale_change_info_order', function (require) {
    "use strict";

    $('.oe_website_sale').each(function () {
        var oe_website_sale = this;

        $(oe_website_sale).on('click', 'a.js_checkout_btn', function (ev) {
            window.location.href = '/shop/checkout';
        });

    });
});

Problem is can't load my inherited javascript file. How to fix this problem? I need any solution. Console:

the line code is:

/comment:My js file can't load/