summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2014-06-22 15:30:57 +0200
committerChristophe Simonis <chs@odoo.com>2014-06-22 15:30:57 +0200
commit1f20f61ab4f6acf79f4db6ba9a17c1282014ef5f (patch)
treec7c529d2dfa15a007eebbf8fe90d830d157adaa7 /addons/web/static/src
parent4be9142c117423326203b5812f7ac9d19c673608 (diff)
parent75884c3e1a06f9f6c2ffd4ab272287369f9a325c (diff)
[MERGE] forward port of branch saas-3 up to 75884c3
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/css/base.css18
-rw-r--r--addons/web/static/src/css/base.sass13
-rw-r--r--addons/web/static/src/js/view_form.js16
-rw-r--r--addons/web/static/src/js/view_list_editable.js17
4 files changed, 46 insertions, 18 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index fcab3890140..9fb53aab8e9 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -2611,11 +2611,11 @@
.openerp .oe_list_editable .oe_list_content td.oe_list_field_cell {
padding: 4px 6px 3px;
}
-.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) {
+.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell {
color: transparent;
text-shadow: none;
}
-.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell:not(.oe_readonly) * {
+.openerp .oe_list.oe_list_editable.oe_editing .oe_edition .oe_list_field_cell * {
visibility: hidden;
}
.openerp .oe_list.oe_list_editable.oe_editing .oe_m2o_drop_down_button {
@@ -2631,6 +2631,13 @@
min-width: 0;
max-width: none;
}
+.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_list_field_handle {
+ color: transparent;
+}
+.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_readonly {
+ padding: 4px 6px 3px;
+ text-align: left;
+}
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea {
height: 27px;
-moz-border-radius: 0;
@@ -2642,9 +2649,14 @@
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field textarea, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field select {
min-width: 0;
}
-.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input {
+.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float.oe_readonly, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer.oe_readonly {
+ padding: 6px 0px 0px;
text-align: right;
+ max-width: 100px;
+}
+.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_float input, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_view_integer input {
width: 100% !important;
+ text-align: right;
}
.openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_datetime input.oe_datepicker_master, .openerp .oe_list.oe_list_editable.oe_editing .oe_form_field.oe_form_field_date input.oe_datepicker_master {
width: 100% !important;
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 12d9d83e48e..6c1ba2d80ef 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -2117,7 +2117,7 @@ $sheet-padding: 16px
.oe_list_editable .oe_list_content td.oe_list_field_cell
padding: 4px 6px 3px
.oe_list.oe_list_editable.oe_editing
- .oe_edition .oe_list_field_cell:not(.oe_readonly)
+ .oe_edition .oe_list_field_cell
*
visibility: hidden
color: transparent
@@ -2129,6 +2129,11 @@ $sheet-padding: 16px
.oe_input_icon
margin-top: 5px
.oe_form_field
+ &.oe_list_field_handle
+ color: transparent
+ &.oe_readonly
+ padding: 4px 6px 3px
+ text-align: left
min-width: 0
max-width: none
input, textarea
@@ -2139,9 +2144,13 @@ $sheet-padding: 16px
input, textarea, select
min-width: 0
&.oe_form_field_float,&.oe_form_view_integer
- input
+ &.oe_readonly
+ padding: 6px 0px 0px
text-align: right
+ max-width: 100px
+ input
width: 100% !important
+ text-align: right
&.oe_form_field_datetime,&.oe_form_field_date
input.oe_datepicker_master
width: 100% !important
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index e651fbba26f..27a67880168 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -2695,7 +2695,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);
+ }
}
});
@@ -3386,6 +3388,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);
@@ -3517,6 +3520,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) {
@@ -3718,11 +3722,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;
});