Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1320 Zobrazení

/** @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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvc 25
1167
0
led 25
1227
2
kvě 25
1115
1
pro 24
1615
0
zář 24
1071