[FIX] Fix domains and contexts

bzr revid: fme@openerp.com-20120319145332-pqvak542qxtjm2w3
This commit is contained in:
Fabien Meghazi 2012-03-19 15:53:32 +01:00
parent 064e0c522e
commit 760f469af2
1 changed files with 9 additions and 1 deletions

View File

@ -1251,9 +1251,17 @@ session.web.xml_to_json = function(node) {
return node.data;
break;
case 1:
var attrs = $(node).getAttributes();
_.each(['domain', 'filter_domain', 'context', 'default_get'], function(key) {
if (attrs[key]) {
try {
attrs[key] = JSON.parse(attrs[key]);
} catch(e) { }
}
});
return {
tag: node.tagName.toLowerCase(),
attrs: $(node).getAttributes(),
attrs: attrs,
children: _.map(node.childNodes, session.web.xml_to_json)
}
}