[fix] possible bug in rendering engine

bzr revid: nicolas.vanhoren@openerp.com-20120410131746-uf4yfwx6a8ad3xnp
This commit is contained in:
niv-openerp 2012-04-10 15:17:46 +02:00
parent b660349e94
commit a4c4729251
1 changed files with 5 additions and 2 deletions

View File

@ -933,6 +933,7 @@ openerp.web.form.FormRenderingEngine = openerp.web.Class.extend({
this.process($new_form);
},
preprocess_field: function($field) {
var self = this;
var name = $field.attr('name'),
field_colspan = parseInt($field.attr('colspan'), 10),
field_modifiers = JSON.parse($field.attr('modifiers') || '{}');
@ -942,8 +943,10 @@ openerp.web.form.FormRenderingEngine = openerp.web.Class.extend({
$field.attr('nolabel', '1');
var found = false;
this.$form.find('label[for="' + name + '"]').each(function(i ,el) {
if ($(el).parents("field").length === 0)
found = true;
$(el).parents().each(function(unused, tag) {
if (tag.tagName.toLowerCase() in self.tags_registry.map)
found = true;
});
});
if (found)
return;