Skip to Content
Menú
This question has been flagged
1 Respondre
1313 Vistes

/** @odoo-module */

import { ReceiptScreen } from "@point_of_sale/src/app/screens/receipt_screen/receipt_screen";import { patch } from "@web/core/utils/patch";

patch(ReceiptScreen.prototype, { setup() { super.setup(); console.log("Receipt Screen Inherited"); },

async printExampleButton() { console.log("Example button clicked!"); await this.notification.add("¡Botón de ejemplo clickeado!", { type: "success", }); },});

??

Avatar
Descartar
Best Answer

Hi,


Inherit receipt screen template for adding button:

<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

    <t t-name="ReceiptScreen" t-inherit="point_of_sale.ReceiptScreen"

       t-inherit-mode="extension" owl="1">

//Add button

</templates>


/** @odoo-module */


import { ReceiptScreen } from "@point_of_sale/app/screens/receipt_screen/receipt_screen";

import { patch } from "@web/core/utils/patch";



patch(ReceiptScreen.prototype, {

    setup() {

        super.setup(...arguments);

    },

     //code here

});


Hope it helps

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de jul. 25
1163
0
de gen. 25
1222
2
de maig 25
1084
1
de des. 24
1610
0
de set. 24
1066