[FIX]tooltip: when not in debug mode, display tooltip in form view with bootstrat as well

bzr revid: csn@openerp.com-20140417140452-afqwxqv8pbvpbs3m
This commit is contained in:
Cedric Snauwaert 2014-04-17 16:04:52 +02:00
parent 336fba01e5
commit 4aec292e5c
1 changed files with 6 additions and 2 deletions

View File

@ -1880,7 +1880,11 @@ instance.web.form.FormWidget = instance.web.Widget.extend(instance.web.form.Invi
});
},
}, options || {});
$(trigger).tooltip(options);
//only show tooltip if we are in debug or if we have a help to show, otherwise it will display
//as empty
if (instance.session.debug || widget.node.attrs.help || (widget.field && widget.field.help)){
$(trigger).tooltip(options);
}
},
/**
* Builds a new context usable for operations related to fields by merging
@ -2117,8 +2121,8 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w
this.$el.find('.oe_field_translate').click(this.on_translate);
}
this.$label = this.view ? this.view.$el.find('label[for=' + this.id_for_label + ']') : $();
this.do_attach_tooltip(this, this.$label[0] || this.$el);
if (instance.session.debug) {
this.do_attach_tooltip(this, this.$label[0] || this.$el);
this.$label.off('dblclick').on('dblclick', function() {
console.log("Field '%s' of type '%s' in View: %o", self.name, (self.node.attrs.widget || self.field.type), self.view);
window.w = self;