[FIX] web: many2manytags: hidden if empty and readonly

In edit mode, if this field is readonly and empty, its main div has
height 0 but its border is displayed. This rev. simply hides the field
in this case.
This commit is contained in:
Aaron Bohy
2015-07-07 16:43:01 +02:00
parent 08faf63a6d
commit 81ffa75944
2 changed files with 15 additions and 1 deletions
+11 -1
View File
@@ -692,10 +692,20 @@ var AbstractField = FormWidget.extend(FieldInterface, {
start: function() {
this._super();
this.on("change:value", this, function() {
if (! this.no_rerender)
if (!this.no_rerender) {
this.render_value();
}
this._toggle_label();
});
this.on("change:effective_readonly", this, function() {
this._toggle_label();
});
this.render_value();
this._toggle_label();
},
_toggle_label: function() {
var empty = this.get('effective_readonly') && this.is_false();
this.$el.toggleClass('o_form_field_empty', empty);
},
/**
* Private. Do not use.
@@ -247,6 +247,10 @@
border: 1px solid #CCC;
border-radius: 3px;
&.o_form_field_empty {
display: none;
}
> .oe_form_field {
.o-flex(1, 0, 100px);