Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2123 Tampilan
/** @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

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Jul 17
2850
0
Mar 15
6420
3
Mar 24
5381
0
Nov 23
1845
1
Mei 20
11907