Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
2265 Ansichten
/** @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
Verwerfen
Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Juli 17
2973
0
März 15
6563
3
März 24
5614
0
Nov. 23
1962
1
Mai 20
12037