Hi,
I am introducing Odoo in our organization and encounter an error in my browser (Firefox and Safari).
After finding the problem location, I have a solution, but I am not certain what the best way forward is. First, is patching the code enough or is this a symptom of another problem? Second, what is the best way to submit the patch? As you might guess, I am new to tinkering with Odoo. Please advise.
Here are the details. Request:
http://192.168.99.100/web?debug=#page=0&limit=80&view_type=list&model=project.project&action=142
Popup:
Odoo Client Error
TypeError: undefined is not an object (evaluating 'val.constructor')
http://192.168.99.100/web/static/src/js/pyeval.js:814
After clicking OK (:-)) the next pop-up says:
Odoo Client Error
TypeError: undefined is not an object (evaluating 'dict['widget'].get('value')[1]')
undefined:74
I use Odoo version 8.0-20150401 from the Docker image. The code at odoo-8.0/addons/web/static/src/js/pyeval.js 814 is:
var wrap_context = function (context) {
for (var k in context) {
if (!context.hasOwnProperty(k)) { continue; }
var val = context[k];
if (val === null) { continue; } // <======= also test against undefined?
if (val.constructor === Array) { // <======= line 814
context[k] = wrapping_list.fromJSON(val);
} else if (val.constructor === Object
&& !py.PY_isInstance(val, py.object)) {
context[k] = wrapping_dict.fromJSON(val);
}
}
return context;
};
At first glance I would say that the test for null should also include a test for undefined. Any thoughts from more experienced hackers?
Regards, Markus
Judging by the comments and answers, no one else encounters this problem. It was probably caused by a timeout of the nginx proxy. After tuning the proxy and restoring a backup of the data we seem to have no reoccurrence of the problem. Thank you for your time :-)