[Odoo 12 EE]Custom JS not loading

  javascript, odoo

I created a module who who display a wizard on the "stock_barcode" module in odoo
when i try it on a fresh install of odoo it works perfectly but once i install it on the production server nothing happens even the console.log message don’t appear

Can someone tell me how to debug this ?

my code is below:

<template id="assets_backend" name="stock_barcode assets" inherit_id="web.assets_backend">
        <xpath expr="//script[last()]" position="after">
            <script type="text/javascript" src="/barcode_ext/static/src/js/client_action/lines_widget.js"></script>
         </xpath>
   </template>

My JS code is :

LinesWidget.include({
_highlightNextButtonIfNeeded: function(){
    console.log("Line order ::::: ")
    var self = this
    var shouldHighlight = this._isReservationProcessed();
    if(shouldHighlight){
        var $content = $('<p/>').text('Please check if the device is still connected.');
        self.carrier_id = self.__parentedParent.initialState.carrier_id[0] || undefined;
        Promise.all([
            self._rpc({
                model: 'delivery.carrier',
                method: 'search_read',
                args: [[], ['id', 'name']],
            })
        ]).then(function(res){
            new Dialog(this, {
            title: _t('Edit Value'),
            size: 'medium',
            $content: $(qweb.render('barcode_ext.SelectionValues.edit', {
                widget: {'carriers': res[0] || [], 'carrier_id':self.carrier_id}
            })),
            buttons: [
                {text: _t('Save'), classes: 'btn-primary', close: true, click: function () {
                    var carrierValue = this.$('select#o_selection_value').val() || false;
                    var weightValue = this.$('input#o_weight_value').val() || 0.0;
                    Promise.all([self._rpc({
                        model: 'stock.picking',
                        method: 'write',
                        args: [[self.__parentedParent.initialState.id], {
                            carrier_id: carrierValue && parseInt(carrierValue) || false,
                            weight_barcode: parseFloat(weightValue)
                        }],
                    })]).then(function(res){
                        debugger
                        self.trigger_up('validate');
                    });
                }},
                {text: _t('Close'), close: true},
            ],
        }).open();
        })
    }
    this._super.apply(this, arguments);
}

Source: Ask Javascript Questions

LEAVE A COMMENT