1

I am trying to inherit/override listener of Point of Sale's ProductScreen. Owl.js is new for me I Spend many hours but can't find any solution.

Here is the code of listener event of point of sale module

useListener('click-product', this._clickProduct);

async _clickProduct(event) {
            // base code
        }

So basically I create extended module and need to override the method _clickProduct so I can do my custom stuff.

Thanks.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58

1 Answers1

1

I found a way to inherit method

const ProductScreen = require('point_of_sale.ProductScreen');
const MyProductScreen = ProductScreen => class extends ProductScreen {

    async _clickProduct(event) {
        return super._clickProduct(...arguments);
    }

}