in Odoo 11 you need to use
var rpc = require('web.rpc');
instead
var Model = require('web.Model');
And later call the method using the .query () method, as shown below:
rpc.query({
model: 'model.name',
method: 'method_name',
args: [{
'arg1': value1,
'arg2': value2,
}]
}).then(function (returned_value) {
source
share