In a NumberBuffer Class I want to add some elements to const Set INPUT_KEYS.
The code :
odoo.define('point_of_sale.NumberBuffer', function(require) {
'use strict';
const { Component } = owl;
const { EventBus } = owl.core;
const { onMounted, onWillUnmount, useExternalListener } = owl.hooks;
const { useListener } = require('web.custom_hooks');
const { parse } = require('web.field_utils');
const { BarcodeEvents } = require('barcodes.BarcodeEvents');
const { _t } = require('web.core');
const { Gui } = require('point_of_sale.Gui');
const INPUT_KEYS = new Set(
['Delete', 'Backspace', '+1', '+2', '+5', '+10', '+20', '+50'].concat('0123456789+-.,'.split(''))
);
.
.
.
my code for adding three elements is:
var NumberBuffer = require('point_of_sale.NumberBuffer');
NumberBuffer.include({
init: function() {
var self = this;
this._super.apply(this, arguments);
this.INPUT_KEYS.add('+1000');
this.INPUT_KEYS.add('+5000');
this.INPUT_KEYS.add('+10000');
},
});
I get this error:
NumberBuffer.include is not a function TypeError: NumberBuffer.include is not a function
I don't know if i have to use extends or include to achieve my goal (add in INPUT_KEYS some elements from inheriting cause I can't edit the file source).