Adding an action button on the keyboard
As we discussed in the previous recipe, 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. In this recipe, we will use one such utility and create an action button at the top of the keyboard panel.
Getting ready
In this recipe, we will be using the pos_demo
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 for applying 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/pos_demo.js
file, which will define the...