From 6ed6a512bfec8e2415da2d19304215fcd06273b2 Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Fri, 19 Aug 2022 11:05:39 +0000 Subject: [PATCH] [FIX] web: restore order-* for some `oe_stat_button` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In BS4, the classes utilities order was set from `-1` (first) to `13` (last). This commit restores the old behaviour. In BS5, you only have a range from `-1` to `6`. These classes are used in Odoo to order the `oe_stat_button` particularly for UTM campaign. The order is set using CSS as there no simple way to do it using `XPath` as there are many module (installed or not) targeting the `oe_stat_button`. closes odoo/odoo#98458 Signed-off-by: Adrien Dieudonné (adr) --- .../src/libs/bootstrap/utilities_custom.scss | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/addons/web/static/src/libs/bootstrap/utilities_custom.scss b/addons/web/static/src/libs/bootstrap/utilities_custom.scss index af38346e403..4e521085470 100644 --- a/addons/web/static/src/libs/bootstrap/utilities_custom.scss +++ b/addons/web/static/src/libs/bootstrap/utilities_custom.scss @@ -40,6 +40,17 @@ $utilities-sizes: map-merge( ) ); +$order-array: ( + first: -1, + last: $grid-columns + 1, +) !default; +@for $i from 1 through $grid-columns { + $order-array: map-merge( + $order-array, + (#{$i}: $i) + ); +} + $utilities: () !default; $utilities: map-merge( @@ -112,6 +123,12 @@ $utilities: map-merge( ), ), ), + "order": map-merge( + map-get($utilities, "order"), + ( + values: $order-array, + ), + ), ), );