According to Odoo, โthe Odoo Web LIbrary (OWL) is a smallish UI framework intended to serve as the foundation for the Odoo Web Client.โ The OWL is a modern framework written in TypeScript that takes the best ideas from React, and Vue presents them in a clear and consistent manner.โ
Now, let's look at how to make a custom popup in Odoo 16 when you click a POS button.
Please refer to the blog: How to Create a Custom Pop-Up in Odoo 16 PoS Using OWL for more information on adding custom popups in your POS.
This blog will walk you through the process of creating a custom number popup in Odoo 16 POS using owl. The following diagram depicts the construction of the custom module.

To obtain the default number popup, we must provide โNumberPopupโ as shown in the code below, and then we will obtain the input value if confirmed as the payload (the value consoled in the code below).
To obtain a number popup, we must provide 'NumberPopup' as shown in the code below, and then we will obtain the input value if confirmed as the payload (the value consoled in the code below).
async onClick() {
var self = this;
const {confirmed,payload} = await this.showPopup(โNumberPopupโ, {
Title: this.env._t(โSuccessโ),
});
If (confirmed){
console.log(payload)
}
} The resulting number popup window is depicted in the image below.

If we want to extend the number popup, create a new file number_popup.js.
We can use the code:
Odoo.define(โmodule_name.filenameโ, function(require) {
โuse strictโ;
const Registries = require(โpoint_of_sale.Registriesโ);
const NumberPopup = require(โpoint_of_sale.NumberPopupโ);
const Popup = (NumberPopup) =>
class extends NumberPopup {
//Write your functions here
}
Registries.Component.extend(NumberPopup, Popup);
return Popup;
});For creating a custom number popup create a new template that inherits the number popup template.
Create a new xml file number_popup.xml. For example:
If we want to remove some of the keys from the default number popup, we can use the code below.
<templates id=โtemplateโ xml:space=โpreserveโ>
<t t-name=โNumberPopupโ t-inherit=โpoint_of_sale.NumberPopupโ t-inherit-mode=โextensionโ owl=โ1โ>
<Draggable>
<div class=โpopup popup-numberโ t-att-class=โ{ โpopup-passwordโ : props.isPassword }โ>
<header class=โtitle drag-handleโ>
<t t-esc=โprops.titleโ/>
</header>
<div class=โpopup-input value activeโ>
<span t-att-class=โ{ โhighlightโ: state.toStartOver }โ>
<t t-esc=โinputBufferโ/></span>
</div>
<div class=โpopup-numpadโ>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ1โ)โ>1</button>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ2โ)โ>2</button>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ3โ)โ>3</button><br/>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ4โ)โ>4</button>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ5โ)โ>5</button>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ6โ)โ>6</button><br/>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ7โ)โ>7</button>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ8โ)โ>8</button>
<button class=โinput-button number-charโ t-on-mousedown.prevent=โ() => this.sendInput(โ9โ)โ>9</button>
<button class=โinput-button numpad-charโ t-on-mousedown.prevent=โ() =>
this.sendInput(โDeleteโ)โ>C</button>
<button class=โinput-button numpad-charโ t-on-mousedown.prevent=โ() =>
this.sendInput(0)โ>0</button>
<button class=โinput-button numpad-backspaceโ t-on-mousedown.prevent=โ() =>
this.sendInput(โBackspaceโ)โ>
<img style=โpointer-events: none;โ src=โ/point_of_sale/static/src/img/backspace.pngโ width=โ24โ height=โ21โ alt=โBackspaceโ/>
</button>
<br/>
</div>
<footer class=โfooter centeredโ>
<div class=โbutton cancelโ t-on-mousedown.prevent=โcancelโ>
<t t-esc=โprops.cancelTextโ/>
</div>
<div class=โbutton confirm highlightโ t-on-mousedown.prevent=โconfirmโ>
<t t-esc=โprops.confirmTextโ/>
</div>
</footer>
</Draggable>
</t>
</templates>
The number popup window is depicted in the image below :
This blog will help create a custom number popup by inheriting the template. And we can customize the number popup.