跳至内容
菜单
此问题已终结
2900 查看

https://www.odoo.com/documentation/8.0/reference/javascript.html#rpc

1) create a new page on a demo database

2) Edit page in HTML-editor:

<?xml version="1.0"?>

<t t-name="website.js">

<t t-call="website.layout">

<div id="wrap" class="oe_structure oe_empty"/>

<script>

function Button(){

var Users = new openerp.Model('res.users');

Users.query(['name', 'login', 'user_email', 'signature'])

.filter([['active', '=', true]])

.limit(2)

.all().then(function (users) {

alert(users);

});

}

</script>
     <button onclick='Button()' >Click Me</button>
</t>
</t>


I got TypeError: Users.query is not a function


Any Idea?

形象
丢弃
相关帖文 回复 查看 活动
0
6月 25
307
1
6月 25
616
1
6月 25
604
1
5月 25
1177
0
3月 25
667