Development Book V17:Point Of Sales

Custom javascript files

The management of assets, including custom JavaScript files, has changed significantly in Point of Sale (POS) version 17. To provide more flexibility and efficiency, the method for adding these assets to the POS system has been changed.

1. This is the module structure for customizing a Javascript file in POS.

odoo-development

2. Define the console at the beginning of the POS session.

/* @odoo-module */

import { registry } from "@web/core/registry";
console.log('Custom POS Receipts')

3. Registration of JavaScript assets at the point of sale:

'assets': {
    'point_of_sale._assets_pos': [
        'custom_pos_receipt/static/src/js/custom_pos_receipt.js',
     ]
},

Start the module named custom_pos_javascript_file. To observe the changes in action, start a new session from the point of sale area.

How it works

JavaScript is included in the module. Start a console log. You must open the developer tools in your browser to view the message. On the console tab, you may view the log that follows. Your JavaScript file was successfully submitted, as shown by this.

odoo-development
whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message