Modifying customer receipts
When you customize a Point of Sale application, a common request you get from customers is to modify customer receipts. In this recipe, you will learn how to modify customer receipts.
Getting ready
In this recipe, we will use the point_of_sale_customization
module created in the Modifying existing business logic recipe. We will add one line to the Point of Sale receipt to show how much money the customer saved in the order.
How to do it…
Follow these steps to modify a customer receipt in the Point of Sale application:
- Add the following code to the
/static/src/js/point_of_sale_customization.js
file. This will add extra data to the receipt environment:/** @odoo-module */ import { Order } from "@point_of_sale/app/store/models"; import { patch } from "@web/core/utils/patch"; patch(Order.prototype, { Â Â Â saved_amount(){ Â Â Â Â Â Â Â const order = this; Â Â Â ...