I want to call python function in java script. I tried but it's not working.
Here is the my PY code:
class CoustomModel(models.Model):
_name = 'custom.model'
new_field = fields.Char(string="test", required=False, )
@api.model
def my_function(self):
print("Hello Word");
Here is the JavaScriptodoo.define('visio_learn_javascript.SampleWork', function (require) {
"use strict";
var rpc = require("web.rpc")
var Model = require('web.Model');
var custom_model = new Model('custom.model');
custom_model.call('my_function');
});