I have problem is, i can't add function for my custom button to print reciept in POS
Here my js code: POS/static/src/js/pos.js
odoo.define('POS.pos', function (require) {
'use strict';
var models = require('point_of_sale.models');
var core = require('web.core');
var Widget = require('web.Widget');
var ajax = require('web.ajax');
var qweb = core.qweb;
ajax.loadXML('/POS/static/src/xml/custom_pos.xml', qweb);
});
And here is my POS/static/src/xml/custom_pos.xml:
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="PaymentScreenWidget" t-extend="PaymentScreenWidget">
<t t-jquery='.payment-buttons' t-operation='append'>
<span class="control-button">
<i class="fa fa-print"></i>
Custom Button
</span>
</t>
</t>
</templates >
And here my xml in views
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="demo_example_ext_js" name="Demo Example Ext Js" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/POS/static/src/js/pos.js"></script>
</xpath>
</template>
</odoo>
How can i add function print reciept for my custom button, just like "Print Reciept" have already in POS when you click Validate Button?