summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/form_common.js
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2015-07-07 10:34:18 +0200
committerAaron Bohy <aab@odoo.com>2015-07-07 16:43:01 +0200
commit81ffa759442f10387a306aa85367a237e07c7fb3 (patch)
treee4829fcfed2077b6b32100c9bc86f25195996504 /addons/web/static/src/js/views/form_common.js
parent08faf63a6dd436804875164ab3c9141a1edcfdda (diff)
[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.
Diffstat (limited to 'addons/web/static/src/js/views/form_common.js')
-rw-r--r--addons/web/static/src/js/views/form_common.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form_common.js b/addons/web/static/src/js/views/form_common.js
index cd6d061919f..19737746b4a 100644
--- a/addons/web/static/src/js/views/form_common.js
+++ b/addons/web/static/src/js/views/form_common.js
@@ -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.