How to do it...

To load assets in the Point of Sale application, follow these steps:

  1. Add a new SCSS file at /pos_demo/static/src/scss/pos_demo.scss and insert the following code:
.pos .pos-content {
.price-tag {
background: #00abcd;
width: 100%;
right: 0;
left: 0;
top:0;
}
}
  1. Add a JavaScript file at /pos_demo/static/src/js/pos_demo.js and add the following:
console.log('Point of Sale JavaScript loaded');
  1. Register these JavaScript and SCSS files into the point_of_sale assets:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/JavaScript"
src="/pos_demo/static/src/js/pos_demo.js"/>
<link rel="stylesheet"
href="/pos_demo/static/src/scss/pos_demo.scss"/>
</xpath>
</template>
</data>
</odoo>

Install the pos_demo module. To see your changes in action, open the point-of-sale session from the Point of Sale|Dashboard menu.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset