Hello, I have been trying to resolve this issue, but I have no idea what's wrong.
I have this template:
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="devtest_owl.SetFiscalType">
<button class="button btn btn-light btn-lg w-100 w-md-50 lh-lg text-truncate" t-on-click="onClick">
<i class="fa fa-user-check me-2"/>
<span>Set fiscal Type</span>
</button>
</t>
</templates>
And this JS:
import { Component } from "@odoo/owl";
export class SetFiscalType extends Component {
static template = "devtest_owl.SetFiscalType";
setup() {
super.setup(...arguments);
}
async onClick() {
console.log("Hello");
}
}
And I want to include in this template:
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="devtest_owl.PaymentScreenButtons" t-inherit="point_of_sale.PaymentScreenButtons" t-inherit-mode="extension">
<xpath expr="//button[hasclass('partner-button')]" position="after">
<!-- Here -->
<SetFiscalType order="currentOrder"/>
</xpath>
</t>
</templates>
Using this JS:
import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";
import { SetFiscalType } from "./set_fiscal_type";
patch(PaymentScreen.prototype, {
components: {
...PaymentScreen.prototype.components,
SetFiscalType,
},
});
This is my manifest:
"assets": {
"point_of_sale._assets_pos": [
"devtest_owl/static/src/js/set_fiscal_type.js",
"devtest_owl/static/src/js/register_components.js",
"devtest_owl/static/src/js/payment_screen_patch.js",
"devtest_owl/static/src/xml/set_fiscal_type.xml",
"devtest_owl/static/src/xml/pos_payment_screen.xml",
],
},