From c3d5fdf82daf57acd6b28dd51c93863f653a7807 Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Fri, 15 Feb 2019 18:36:17 +0200 Subject: [PATCH] [IMP] web_widget_x2many_2d_matrix: center header cell --- web_widget_x2many_2d_matrix/__manifest__.py | 2 +- .../static/src/css/web_widget_x2many_2d_matrix.css | 3 --- .../static/src/js/2d_matrix_renderer.js | 5 ++++- .../static/src/scss/web_widget_x2many_2d_matrix.scss | 10 ++++++++++ web_widget_x2many_2d_matrix/views/assets.xml | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) delete mode 100644 web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css create mode 100644 web_widget_x2many_2d_matrix/static/src/scss/web_widget_x2many_2d_matrix.scss diff --git a/web_widget_x2many_2d_matrix/__manifest__.py b/web_widget_x2many_2d_matrix/__manifest__.py index 36e97340..c26e9f47 100644 --- a/web_widget_x2many_2d_matrix/__manifest__.py +++ b/web_widget_x2many_2d_matrix/__manifest__.py @@ -4,7 +4,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': '2D matrix for x2many fields', - 'version': '12.0.1.0.2', + 'version': '12.0.1.0.3', 'author': ( 'Therp BV, ' 'Tecnativa, ' diff --git a/web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css b/web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css deleted file mode 100644 index 907f507d..00000000 --- a/web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css +++ /dev/null @@ -1,3 +0,0 @@ -.o_field_x2many_2d_matrix .row-total { - font-weight: bold; -} diff --git a/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js b/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js index 7eb3c39d..cb9b5d05 100644 --- a/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js +++ b/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js @@ -68,7 +68,8 @@ odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixRenderer', function (requ } var $table = $('').addClass( - 'o_list_view table table-condensed table-striped' + 'o_list_view table table-condensed table-striped ' + + 'o_x2many_2d_matrix ' ); this.$el .addClass('table-responsive') @@ -153,6 +154,8 @@ odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixRenderer', function (requ field.type === 'monetary' ) { $th.addClass('text-right'); + } else { + $th.addClass('text-center'); } if (config.debug) { diff --git a/web_widget_x2many_2d_matrix/static/src/scss/web_widget_x2many_2d_matrix.scss b/web_widget_x2many_2d_matrix/static/src/scss/web_widget_x2many_2d_matrix.scss new file mode 100644 index 00000000..73291a02 --- /dev/null +++ b/web_widget_x2many_2d_matrix/static/src/scss/web_widget_x2many_2d_matrix.scss @@ -0,0 +1,10 @@ +.o_field_x2many_2d_matrix .row-total { + font-weight: bold; +} + +.o_x2many_2d_matrix { + thead > tr > th { + // Respect newline characters + white-space: pre-line; + } +} diff --git a/web_widget_x2many_2d_matrix/views/assets.xml b/web_widget_x2many_2d_matrix/views/assets.xml index 6083a642..b26566e5 100644 --- a/web_widget_x2many_2d_matrix/views/assets.xml +++ b/web_widget_x2many_2d_matrix/views/assets.xml @@ -9,7 +9,7 @@