Fix Screen.domain_parser to filter only field in view

and remove duplicate 'id' addition

issue5815
review30441002
This commit is contained in:
Cédric Krier
2016-08-25 19:12:43 +02:00
parent 73481748c1
commit a2ef328750
+4 -10
View File
@@ -1270,15 +1270,16 @@
// Filter only fields in XML view
var xml_view = jQuery(jQuery.parseXML(view_tree.arch));
var xml_fields = xml_view.find('tree').children()
.filter(function(node) {
.filter(function(i, node) {
return node.tagName == 'field';
}).map(function(node) {
}).map(function(i, node) {
return node.getAttribute('name');
});
var dom_fields = {};
xml_fields.each(function(name) {
xml_fields.each(function(k, name) {
dom_fields[name] = fields[name];
});
fields = dom_fields;
}
// Add common fields
@@ -1307,13 +1308,6 @@
}
}
});
if (!('id' in fields)) {
fields.id = {
'string': Sao.i18n.gettext('ID'),
'name': 'id',
'type': 'integer'
};
}
var context = jQuery.extend({},
this.model.session.context,