Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda