Hi ! I'm on Odoo (v8).
I try to add some Javascript in my Odoo website.
Here's a sample of JS:
$(document).ready(function () {
var foobar = new openerp.Model("foo.bar");
var ids = foobar.call("get_dummy_ids", 1);
});
Here's where I include it:
<template id="my_module.assets_frontend" name="Website assets">
<script type="text/javascript" src="/my_module/static/src/js/my_js.js"></script>
</template>
And here's the error:
Uncaught Error: Not session specified
Anyone have messed up with this issue ?
Update:
I tried this js code:
new openerp.Model(new openerp.Session(), 'res.users').call('search')
But it says:
"Server application error" Object { message: "Odoo Session Expired", code: 100, data: Object }
declare/genericJsonRpc/result<() ceba8ad:1120
.Deferred/promise.then/</</<() ceba8ad:249
jQuery.Callbacks/fire() ceba8ad:243
jQuery.Callbacks/self.fireWith() ceba8ad:248
done() ceba8ad:682
.send/callback()
Since I try to call it when no user is logged in, I kind of get it. But then, is there a way to query the model when no user is logged in ?