I did but the button is not displayed, below is my code.
custom_buttom_payment.js:
odoo.define('pos_custom_button_payment.custom_button_payment', function (require) {
"use strict";
var screen = require('point_of_sale.screens');
screen.PaymentScreenWidget.include({
renderElement: function() {
var self = this;
this._super();
this.$('.js_clear_orderline').click(function(){
});
},
});
});
button_custom.xml:
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="PaymentScreenWidget">
<t t-jquery="div[class*='js_set_customer']" t-operation="after">
<div class='left_button js_clear_orderline'>
<div class="button-icon">
<img src="/pos_custom_button_payment/static/src/icons/icon.png" class="pos_logo"/>
</div>
<div class='button-name'>
HELLO
</div>
</div>
</t>
</t>
</templates>
view.xml:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="pos_custom_button" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_custom_button_payment/static/src/js/custom_button_payment.js"/>
</xpath>
</template>
</data>
</odoo>
Hope everyone can help me, I've tried many ways but it still doesn't work.
You probably forgot to add the template file under the
qweb
entry in the manifest fileExample: