From 4e48c6d6dea9abb5bd25bb0f5d068e4052cbe95b Mon Sep 17 00:00:00 2001 From: "Mathieu (mano)" Date: Fri, 2 Dec 2022 13:11:27 +0000 Subject: [PATCH] [IMP] sale,purchase: product matrix revamp v16 The product matrix was recently converted to OWL but the design was not adapted to v16 style. This commit revamps the table to better fits Odoo 16 design. The previous table had issue with wrong color in dark mode and the table head title were not aligned with the inputs. task-3074063 closes odoo/odoo#107102 Related: odoo/enterprise#34743 Signed-off-by: Victor Feyens (vfe) --- .../static/src/scss/product_matrix.scss | 73 ++++++------------- .../static/src/xml/product_matrix.xml | 45 +++++++----- .../static/src/xml/product_matrix_dialog.xml | 2 +- .../tours/purchase_product_matrix_tour.js | 4 +- .../static/tests/tours/product_matrix_tour.js | 8 +- 5 files changed, 56 insertions(+), 76 deletions(-) diff --git a/addons/product_matrix/static/src/scss/product_matrix.scss b/addons/product_matrix/static/src/scss/product_matrix.scss index 4d27ed224f9..d22f3a32a9c 100644 --- a/addons/product_matrix/static/src/scss/product_matrix.scss +++ b/addons/product_matrix/static/src/scss/product_matrix.scss @@ -1,59 +1,28 @@ -.o_web_client .o_matrix_input_table { - table { - margin-bottom: 0; - table-layout: fixed; - min-width: 100%; - width: auto; - max-width: none; +.o_matrix_input_table { + .o_matrix_ps { + padding-left: $modal-inner-padding; } - th, td { - border: 0 !important; - vertical-align: middle; - width: 5em; + .o_matrix_pe { + padding-right: $modal-inner-padding; } - .o_matrix_title_header { - width: 10em; - } - thead { - color: $o-main-text-color; - background-color: $o-brand-lightsecondary; - th { - text-align: center; - white-space: pre-line; + //removing input field=number arrows as their size might + //change depending on browser default styling and shift input's position + .o_matrix_input { + &::-webkit-outer-spin-button, + &::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + &[type=number] { + -moz-appearance: textfield; } } - tbody { - background-color: $o-view-background-color; - text-align: right; - tr { - border-top: 1px solid $o-form-lightsecondary; - border-bottom: 1px solid $o-form-lightsecondary; - } - .o_matrix_input { - text-align: right; - border: none; - } - } - .o_matrix_text_muted{ - color: lighten($o-main-text-color, 15%); - font-style: italic; - } - - // ensure white background completely surrounds nocontent bubble - .o_matrix_nocontent_container { - overflow: auto; - - .oe_view_nocontent_img_link { - padding:10px; - } - } -} - -.o_product_variant_matrix { - .form-control { - &:focus { - box-shadow: none; - border: 1px solid $gray-400; + .o_matrix_input_td { + border: none; + &:focus-within { + --table-accent-bg: none; + background-color: $o-view-background-color; + border-bottom: $o-black 1px solid; } } } diff --git a/addons/product_matrix/static/src/xml/product_matrix.xml b/addons/product_matrix/static/src/xml/product_matrix.xml index 8e82b7dce4a..3d006412a13 100644 --- a/addons/product_matrix/static/src/xml/product_matrix.xml +++ b/addons/product_matrix/static/src/xml/product_matrix.xml @@ -1,33 +1,44 @@