call() and query() method are the odoo methods which are used in def function in .py file, it is used to call the value.
To call the Odoo server objects we use two primary methods which are call() and query(), for this see the code example below and if you need it then use it in your .py file/p>
var Users = new Model('res.users');
Users.call('change_password', ['oldpassword', 'newpassword'],
{context: some_context}).then(function (result) {
// do something with change_password result
});
Users.query(['name', 'login', 'user_email', 'signature'])
.filter([['active', '=', true], ['company_id', '=', main_company]])
.limit(15)
.all().then(function (users) {
// do work with users records
});
Note-Its usage is similar to that of the Odoo Model API,
0 Comment(s)