跳至內容
選單
此問題已被標幟
1 回覆
2195 瀏覽次數
/** @odoo-module */

import { DiscountButton } from "@pos_discount/overrides/components/discount_button/discount_button";
import { ErrorPopup } from "@point_of_sale/app/errors/popups/error_popup";
import { patch } from "@web/core/utils/patch";
import { _t } from "@web/core/l10n/translation";

patch(DiscountButton.prototype, {

async apply_discount(pc) {
console.log("test")
await super.apply_discount(arguments);
},
});

this code didn't work 
can anyone help me with this ?
thank you so much

頭像
捨棄
最佳答案

Hi,


The super.apply_discount(arguments) call should be corrected to super.apply_discount(pc) since apply_discount takes a single argument (pc).


import { DiscountButton } from "@pos_discount/overrides/components/discount_button/discount_button";


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



patch(DiscountButton.prototype, {


    async apply_discount(pc) {


        console.log("test");


        await super.apply_discount(pc);


    },


});




Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
7月 17
2889
0
3月 15
6462
3
3月 24
5497
0
11月 23
1902
1
5月 20
11979