I'm developing an Odoo module in which I add a button to existing module, this button when clicked should execute a certain function. Whenever I click this button, the function executes as desired but later I get an error: Cannot read property 'then' of undefined
The button definition in the view:
<button onclick="myclick()">Click me</button>
The JS Code (after simplification):
function myclick()
{
console.log("hi");
}
What I tried:
- I simplified the code as much as I could but still the error appears.
- I researched the error and I got some results about promises but I still don't know how to resolve this error.