跳至内容
菜单
此问题已终结
1 回复
2149 查看
/** @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
2876
0
3月 15
6439
3
3月 24
5437
0
11月 23
1881
1
5月 20
11937