I want to read a fieldname value from the current user from model res.users with Javascript. I tried the example from https://www.odoo.com/forum/help-1/question/javascript-how-to-get-a-value-of-model-field-119109
It seems thats web.Model and web.DataModel are not working anymore in v11? Console gives missing depencies.
var Model = require('web.DataModel');
var Model = require('web.Model');
For example, this works in v10 and returns: {id: 1, name: "Administrator"}
The same scripts gives 'Missing dependencies: ["web.DataModel"]' in V11
odoo.define('appname.myfunct', function (require) {
"use strict";
var Model = require('web.DataModel');
new Model('res.users').query(['name'])
.filter([['id', '=', 1]])
.first()
.then(function(res) {
console.log(res);
});
});