跳至內容
選單
此問題已被標幟
1 回覆
1310 瀏覽次數

/** @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", }); },});

??

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 25
1161
0
1月 25
1222
2
5月 25
1083
1
12月 24
1609
0
9月 24
1064