From a6dd7075b30b8f1c7500b23503a491f2fa33760a Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Tue, 23 Aug 2022 11:37:49 +0000 Subject: [PATCH] [FIX] *: remove display: contents from field widgets and adapt code With the conversion of the views to owl, we added an extra div around fields that represents the whole field, and wraps potentially multiple elements that may be rendered by a field widget. This changes the DOM structure, and to allow concrete fields to control everything about the way they are displayed, we decided to use the css rule "display: contents" for that div. As it turns out, while this does give more control to the field widget, it breaks a lot of existing css rules, and also prevents classes that are applied on that div from the arch from affecting any css property related to layout (such as margin, position or padding). Because of that, we decided to revert this change, and set this div's display property to inline-block (the same as legacy field widgets) and adapt the few fields where this does not work out of the box, which fixes many issues. Part-of: odoo/odoo#98711 --- addons/membership/views/partner_views.xml | 4 +- .../static/src/scss/project_rightpanel.scss | 2 +- .../static/src/xml/project_templates.xml | 2 +- .../static/src/core/notebook/notebook.scss | 2 +- addons/web/static/src/legacy/scss/fields.scss | 20 +- .../web/static/src/views/fields/fields.scss | 5 - .../src/views/form/button_box/button_box.scss | 102 +++------- .../src/views/form/button_box/button_box.xml | 4 +- .../src/views/form/form_controller.scss | 186 ++---------------- .../static/src/scss/website.backend.scss | 4 + 10 files changed, 62 insertions(+), 269 deletions(-) diff --git a/addons/membership/views/partner_views.xml b/addons/membership/views/partner_views.xml index 538662c1a97..e7a28560b4b 100644 --- a/addons/membership/views/partner_views.xml +++ b/addons/membership/views/partner_views.xml @@ -111,8 +111,8 @@