Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

293
Vistas
Odoo 15 Javascript How to add an element to a const Set from a inherited module?

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).

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda