Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Problem implementing simple Javascript first example in documentation

By
Anders Wallenquist
on 3/24/16, 5:13 AM 270 views

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?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/24/16, 5:13 AM
Seen: 270 times
Last updated: 3/24/16, 5:13 AM