summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2014-06-22 15:36:10 +0200
committerChristophe Simonis <chs@odoo.com>2014-06-22 15:36:10 +0200
commite862ff7033dd001a84d7e0a192d0da7b11384bd9 (patch)
tree349a80be398aeb306d443239c88e522f66d43e39 /addons/web/static/src/js
parent0e595c418612d8236d63ec70c2f8dccb7cff3407 (diff)
parent4cb5381deecdf28d2a0f6b1e7f4b16a611ec9de9 (diff)
[MERGE] forward port of branch saas-5 up to 4cb5381
Conflicts: openerp/addons/base/module/wizard/base_module_upgrade_view.xml
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/view_form.js16
-rw-r--r--addons/web/static/src/js/view_list_editable.js17
2 files changed, 20 insertions, 13 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 3f46c7374ff..956ec494573 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -2810,7 +2810,9 @@ instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instanc
},
set_dimensions: function (height, width) {
this._super(height, width);
- this.datewidget.$input.css('height', height);
+ if (!this.get("effective_readonly")) {
+ this.datewidget.$input.css('height', height);
+ }
}
});
@@ -3510,6 +3512,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
this.floating = false;
this.current_display = null;
this.is_started = false;
+ this.ignore_focusout = false;
},
reinit_value: function(val) {
this.internal_set_value(val);
@@ -3641,6 +3644,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
var ed_delay = 200;
var ed_duration = 15000;
var anyoneLoosesFocus = function (e) {
+ if (self.ignore_focusout) { return; }
var used = false;
if (self.floating) {
if (self.last_search.length > 0) {
@@ -3844,11 +3848,17 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
_search_create_popup: function() {
this.no_ed = true;
this.ed_def.reject();
- return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments);
+ this.ignore_focusout = true;
+ this.reinit_value(false);
+ var res = instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments);
+ this.ignore_focusout = false;
+ this.no_ed = false;
+ return res;
},
set_dimensions: function (height, width) {
this._super(height, width);
- this.$input.css('height', height);
+ if (!this.get("effective_readonly") && this.$input)
+ this.$input.css('height', height);
}
});
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index ea2c28d9c3f..144de8eb21c 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -285,9 +285,7 @@
if (!this.editor.is_editing()) { return; }
for(var i=0, len=this.fields_for_resize.length; i<len; ++i) {
var item = this.fields_for_resize[i];
- if (!item.field.get('effective_invisible')) {
- this.resize_field(item.field, item.cell);
- }
+ this.resize_field(item.field, item.cell);
}
},
/**
@@ -306,6 +304,11 @@
at: 'left top',
of: $cell
});
+ if (field.get('effective_readonly')) {
+ field.$el.addClass('oe_readonly');
+ }
+ if(field.widget == "handle")
+ field.$el.addClass('oe_list_field_handle');
},
/**
* @return {jQuery.Deferred}
@@ -451,13 +454,7 @@
setup_events: function () {
var self = this;
_.each(this.editor.form.fields, function(field, field_name) {
- var set_invisible = function() {
- field.set({'force_invisible': field.get('effective_readonly')});
- };
- field.on("change:effective_readonly", self, set_invisible);
- set_invisible();
- field.on('change:effective_invisible', self, function () {
- if (field.get('effective_invisible')) { return; }
+ field.on("change:effective_readonly", self, function(){
var item = _(self.fields_for_resize).find(function (item) {
return item.field === field;
});