Custom Javascript Files in POS
Point of Sale use a wide range of assets. The loading of assets in Point of Sale assets in Version 15 has undergone significant changes. Let's check how we may do this.
1. Here is the module structure for adding a custom Javascript file to POS,
2. During the start of the POS session, define the console.
odoo.define('custom_pos.pos', function (require) {
"use strict";
console.log("Custom JavaScript In POS")
});
3.JavaScript asset registration at the point of sale:
'assets': {
'point_of_sale.assets': [
'custom_pos_javascript_file/static/src/js/**/*',
],
},
Enter the custom_pos_javascript_file module. Start a new session from the point of sale area to see the changes in action.
How it works
Including javascript in the module. Create a console log. To view the message, you need to open the developer tools in your browser. The following log can be seen on the console tab. This shows that your javascript file was successfully uploaded.