summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-05-08 14:29:44 +0200
committerqsm-odoo <qsm@odoo.com>2017-05-08 17:12:11 +0200
commit111465c3182e0d9387f03d4f28a72b5da0ec8df4 (patch)
tree1e9f112d3e17ed5cd740c7e4856f5b261a20b91d /addons/web/static/src
parent7afe6d28b6eea2d2ca20b491afd2fb46dbea5615 (diff)
[FIX] web: numbers in list views should be right-aligned
Before this commit, numbers in list views were right-aligned depending on the widget they were using (float/monetary). Now, the input text alignment is inherited from the parent which should solve the problem.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/list/list_renderer.js8
-rw-r--r--addons/web/static/src/less/fields.less11
-rw-r--r--addons/web/static/src/less/list_view.less7
3 files changed, 12 insertions, 14 deletions
diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js
index 8437881a771..21028b99e02 100644
--- a/addons/web/static/src/js/views/list/list_renderer.js
+++ b/addons/web/static/src/js/views/list/list_renderer.js
@@ -246,10 +246,12 @@ var ListRenderer = BasicRenderer.extend({
if (node.tag === 'button') {
tdClassName += ' o_list_button';
} else {
- if (node.attrs.widget){
+ var typeClass = FIELD_CLASSES[this.state.fields[node.attrs.name].type];
+ if (typeClass) {
+ tdClassName += (' ' + typeClass);
+ }
+ if (node.attrs.widget) {
tdClassName += (' o_' + node.attrs.widget + '_cell');
- } else {
- tdClassName += (' ' + FIELD_CLASSES[this.state.fields[node.attrs.name].type]);
}
}
var $td = $('<td>', {class: tdClassName});
diff --git a/addons/web/static/src/less/fields.less b/addons/web/static/src/less/fields.less
index 329b4f62fbd..a4685d19dd4 100644
--- a/addons/web/static/src/less/fields.less
+++ b/addons/web/static/src/less/fields.less
@@ -26,7 +26,11 @@
//------------------------------------------------------------------------------
.o_field_widget {
- display: inline-block;
+ // Default display and alignment of widget and internal <input/>
+ &, input.o_input {
+ display: inline-block;
+ text-align: inherit;
+ }
// Block fields
&.note-editor, &.oe_form_field_html, &.oe_form_field_html_text, &.oe_form_field_text, &.o_view_manager_content, &.o_field_domain {
@@ -64,11 +68,6 @@
}
}
- // Input in field
- input[type="text"] {
- display: inline-block;
- }
-
// Text
&.o_field_text, &.oe_form_field_text .oe_form_text_content {
width: 100%;
diff --git a/addons/web/static/src/less/list_view.less b/addons/web/static/src/less/list_view.less
index 0caa775add3..eaf0f1bfba8 100644
--- a/addons/web/static/src/less/list_view.less
+++ b/addons/web/static/src/less/list_view.less
@@ -92,11 +92,11 @@
// Values styling
.o_data_cell {
- &.o_list_number, &.o_field_integer, &.o_field_float, &.o_field_monetary {
+ &.o_list_number {
text-align: right;
white-space: nowrap;
}
- &.o_list_text, &.o_field_text {
+ &.o_list_text {
white-space: pre-wrap;
}
&.o_invisible_modifier {
@@ -174,9 +174,6 @@
.o_field_boolean {
width: auto!important; // Override the width computed in JS (needed for Chrome)
}
- .o_field_number {
- text-align: right;
- }
}
}