【发布时间】:2015-01-04 23:40:13
【问题描述】:
我正在关注documentation 并且有以下 sn-p 如何在 Odoo v 8.0 中进行查询
var Users = new openerp.Model('res.users');
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
});
但是当我执行该代码(使用示例公司 id)时,每次都会出现错误:
TypeError: Users.query 不是函数
有人可以解释一下为什么以及如何在 js 中使用 odoo 进行查询吗?
【问题讨论】:
标签: javascript python odoo