Hi,
im facing a problem with my custom buttons in POS view… error is happening in the js, when i want a call a function in py
here is my code (this code is in pos.js in init function)
this.wrapper.find('button.Calculate').on("click", function() {
alert("test");
me.frm.call({
method: "addons.addons.doctype.on_total_pricing_rule.on_total_pricing_rule.calculate_discount",
args: { args: me },
callback: function(r) {
alert("here");
if (!r.exc && r.message) {
frappe.model.set_value(me.frm.doctype, me.frm.docname, "discount_amount", flt(r.message));
}
}
});
});
the test alert is shown… but after that i got this eror in my console
TypeError: ‘click’ called on an object that does not implement interface HTMLElement
any thought?
thanks,
bobby