Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

294
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!