Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
1312 Prikazi

/** @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
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jul. 25
1162
0
jan. 25
1222
2
maj 25
1083
1
dec. 24
1610
0
sep. 24
1066