[FIX] Do not add @for attribute to labels if not linked to a field

bzr revid: fme@openerp.com-20120329150136-iw5dirrxbqx53qjh
This commit is contained in:
Fabien Meghazi 2012-03-29 17:01:36 +02:00
parent 948c888afb
commit 9a9b9e76bd
1 changed files with 4 additions and 2 deletions

View File

@ -1015,7 +1015,7 @@ openerp.web.FormRenderingEngine = nova.Class.extend({
var dict = {
string: $label.attr('string') || (field_orm || {}).string || '',
help: $label.attr('help') || (field_orm || {}).help || '',
_for: _.uniqueId('oe-field-input-'),
_for: name ? _.uniqueId('oe-field-input-') : undefined,
};
var align = parseFloat(dict.align);
if (isNaN(align) || align === 1) {
@ -1029,7 +1029,9 @@ openerp.web.FormRenderingEngine = nova.Class.extend({
var $new_label = $(QWeb.render('FormRenderingLabel', dict));
$label.before($new_label).remove();
this.handle_common_properties($new_label, $label);
this.labels[name] = $new_label;
if (name) {
this.labels[name] = $new_label;
}
return $new_label;
},
process_button: function($button) {