Skip to Content
Menu
This question has been flagged

/** @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
Discard
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
Discard
Related Posts Replies Views Activity
1
Jul 25
1155
0
Jan 25
1219
2
May 25
1075
1
Dec 24
1597
0
Sep 24
1048