Adding an action button to the keyboard
As we discussed in the previous point, the Point of Sale application is designed in such a way that it works offline. Thanks to this, the code structure of the Point of Sale application is different from the remaining Odoo applications. The code base of the Point of Sale app is largely written with JavaScript and provides different utilities for customization. At this point, we will use one such utility and create an action button at the top of the keyboard panel.
Getting ready
Here, we will use the point_of_sale_customization
module created in the Adding custom JavaScript/SCSS files recipe. We will add a button at the top of the keyboard panel. This button will be a shortcut to apply a discount to the order lines.
How to do it…
Follow these steps to add a 5% discount action button to the keyboard panel for the Point of Sale application:
- Add the following code to the
/static/src/js/point_of_sale_customization.js
file...