Making RPC calls
Though the Point of Sale application works offline, it is still possible to make RPC calls to the server. The RPC call can be used for any operation; you can use it for CRUD operations, or to perform an action on the server.
Now, we will make an RPC call to fetch information about a customer’s last five orders.
Getting ready
Now, we will use the point_of_sale_customization
module created for the Adding an action button in the keyboard recipe. We will define the action button. When the user clicks on the action button, we will make an RPC call to fetch the order information and display it on the popup.
How to do it...
Follow these steps to display the last five orders for the selected customer:
- Add the following code to the
/static/src/js/point_of_sale_customization.js
file; this will add a new action button to fetch and display the information about the last five orders when a user clicks on the button:/** @odoo-module */ import { Component...