From 704f0def1b3a101e2c1d90c255a71506c77e2821 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Thu, 27 Aug 2026 14:26:28 +0200 Subject: [PATCH] [ADD] web_list_striped: zebra striping for all backend list views The zebra rows and the softer hover used to be shipped by stock_picking_batch_custom, but its selector (`table.o_list_table`) carried no module scope, so a warehouse addon was quietly restyling every list view in the database. The scope was lost in 07bd632, while porting the selectors from Odoo 16 to 18. The effect itself is wanted, so keep it and make it explicit: an asset-only addon whose documented purpose is the global reach. Nothing depends on it, so the striping can be turned off by uninstalling a single module. An Odoo theme would not work here: `theme_*` addons only govern the website frontend, and these rules live in `web.assets_backend`. Co-Authored-By: Claude Opus 5 --- web_list_striped/README.rst | 63 +++++++++++++++++++ web_list_striped/__init__.py | 0 web_list_striped/__manifest__.py | 18 ++++++ web_list_striped/readme/CONFIGURE.rst | 8 +++ web_list_striped/readme/CONTRIBUTORS.rst | 4 ++ web_list_striped/readme/CREDITS.rst | 7 +++ web_list_striped/readme/DESCRIPTION.rst | 15 +++++ web_list_striped/readme/INSTALL.rst | 11 ++++ web_list_striped/readme/USAGE.rst | 6 ++ .../static/src/css/web_list_striped.css | 18 ++++++ 10 files changed, 150 insertions(+) create mode 100644 web_list_striped/README.rst create mode 100644 web_list_striped/__init__.py create mode 100644 web_list_striped/__manifest__.py create mode 100644 web_list_striped/readme/CONFIGURE.rst create mode 100644 web_list_striped/readme/CONTRIBUTORS.rst create mode 100644 web_list_striped/readme/CREDITS.rst create mode 100644 web_list_striped/readme/DESCRIPTION.rst create mode 100644 web_list_striped/readme/INSTALL.rst create mode 100644 web_list_striped/readme/USAGE.rst create mode 100644 web_list_striped/static/src/css/web_list_striped.css diff --git a/web_list_striped/README.rst b/web_list_striped/README.rst new file mode 100644 index 0000000..d07f1bf --- /dev/null +++ b/web_list_striped/README.rst @@ -0,0 +1,63 @@ +================ +Web List Striped +================ + +Visión general +============== + +Aplica un efecto cebra (filas alternas sombreadas) y un resaltado de hover más +suave a **todas** las vistas de lista del backend de Odoo. + +El alcance global es intencionado: es justamente lo que hace este módulo. Sirve +para listas largas de almacén, contabilidad o inventario, donde seguir una fila +con la vista es más fácil si las filas alternan de color. + +Es un módulo de sólo CSS: no define modelos, campos ni vistas. Para volver al +aspecto estándar de Odoo basta con desinstalarlo. + +Nota técnica: el selector usa ``:nth-child(even)``, que cuenta todas las ``tr`` +del ``tbody`` y no sólo las filas de datos. En listas agrupadas o con fila de +*"Añadir línea"* la paridad de las bandas puede desajustarse. +``:nth-child(even of .o_data_row)`` lo resolvería, pero exige Chrome 111+ o +Firefox 113+, lo que no es una suposición segura en tablets de almacén. + +Instalación +=========== + +Instalar el módulo: + +:: + + docker-compose run --rm odoo odoo -d odoo --stop-after-init -i web_list_striped + +No tiene más dependencias que ``web``, así que se puede instalar y desinstalar +en cualquier momento sin afectar a datos. + +Configuración +============= + +No requiere configuración. El efecto se aplica al instalar el módulo y +desaparece al desinstalarlo. + +Para cambiar la intensidad de las bandas, edita los valores ``rgba()`` de +``static/src/css/web_list_striped.css``. + +Uso +=== + +No hay nada que usar: una vez instalado, cualquier vista de lista del backend +(Contactos, Facturas, Albaranes, Operaciones detalladas de un lote...) muestra +las filas alternas sombreadas y un hover más suave. + +Contribuidores +============== + +* Criptomart + +Créditos +======== + +Autor +----- + +* Criptomart diff --git a/web_list_striped/__init__.py b/web_list_striped/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/web_list_striped/__manifest__.py b/web_list_striped/__manifest__.py new file mode 100644 index 0000000..678c1cf --- /dev/null +++ b/web_list_striped/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2026 Criptomart +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ # noqa: B018 + "name": "Web List Striped", + "version": "18.0.1.0.0", + "category": "Technical", + "summary": "Zebra striping and softer hover for all backend list views", + "author": "Odoo Community Association (OCA), Criptomart", + "maintainers": ["Criptomart"], + "website": "https://git.criptomart.net/criptomart/addons-cm", + "license": "AGPL-3", + "depends": ["web"], + "assets": { + "web.assets_backend": [ + "web_list_striped/static/src/css/web_list_striped.css", + ], + }, +} diff --git a/web_list_striped/readme/CONFIGURE.rst b/web_list_striped/readme/CONFIGURE.rst new file mode 100644 index 0000000..3e6d6d3 --- /dev/null +++ b/web_list_striped/readme/CONFIGURE.rst @@ -0,0 +1,8 @@ +Configuración +============= + +No requiere configuración. El efecto se aplica al instalar el módulo y +desaparece al desinstalarlo. + +Para cambiar la intensidad de las bandas, edita los valores ``rgba()`` de +``static/src/css/web_list_striped.css``. diff --git a/web_list_striped/readme/CONTRIBUTORS.rst b/web_list_striped/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..46076fe --- /dev/null +++ b/web_list_striped/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +Contribuidores +============== + +* Criptomart diff --git a/web_list_striped/readme/CREDITS.rst b/web_list_striped/readme/CREDITS.rst new file mode 100644 index 0000000..0aef29c --- /dev/null +++ b/web_list_striped/readme/CREDITS.rst @@ -0,0 +1,7 @@ +Créditos +======== + +Autor +----- + +* Criptomart diff --git a/web_list_striped/readme/DESCRIPTION.rst b/web_list_striped/readme/DESCRIPTION.rst new file mode 100644 index 0000000..f46dad4 --- /dev/null +++ b/web_list_striped/readme/DESCRIPTION.rst @@ -0,0 +1,15 @@ +Aplica un efecto cebra (filas alternas sombreadas) y un resaltado de hover más +suave a **todas** las vistas de lista del backend de Odoo. + +El alcance global es intencionado: es justamente lo que hace este módulo. Sirve +para listas largas de almacén, contabilidad o inventario, donde seguir una fila +con la vista es más fácil si las filas alternan de color. + +Es un módulo de sólo CSS: no define modelos, campos ni vistas. Para volver al +aspecto estándar de Odoo basta con desinstalarlo. + +Nota técnica: el selector usa ``:nth-child(even)``, que cuenta todas las ``tr`` +del ``tbody`` y no sólo las filas de datos. En listas agrupadas o con fila de +*"Añadir línea"* la paridad de las bandas puede desajustarse. +``:nth-child(even of .o_data_row)`` lo resolvería, pero exige Chrome 111+ o +Firefox 113+, lo que no es una suposición segura en tablets de almacén. diff --git a/web_list_striped/readme/INSTALL.rst b/web_list_striped/readme/INSTALL.rst new file mode 100644 index 0000000..3d083d0 --- /dev/null +++ b/web_list_striped/readme/INSTALL.rst @@ -0,0 +1,11 @@ +Instalación +=========== + +Instalar el módulo: + +:: + + docker-compose run --rm odoo odoo -d odoo --stop-after-init -i web_list_striped + +No tiene más dependencias que ``web``, así que se puede instalar y desinstalar +en cualquier momento sin afectar a datos. diff --git a/web_list_striped/readme/USAGE.rst b/web_list_striped/readme/USAGE.rst new file mode 100644 index 0000000..c169599 --- /dev/null +++ b/web_list_striped/readme/USAGE.rst @@ -0,0 +1,6 @@ +Uso +=== + +No hay nada que usar: una vez instalado, cualquier vista de lista del backend +(Contactos, Facturas, Albaranes, Operaciones detalladas de un lote...) muestra +las filas alternas sombreadas y un hover más suave. diff --git a/web_list_striped/static/src/css/web_list_striped.css b/web_list_striped/static/src/css/web_list_striped.css new file mode 100644 index 0000000..f0ddb82 --- /dev/null +++ b/web_list_striped/static/src/css/web_list_striped.css @@ -0,0 +1,18 @@ +/* Zebra striping for every backend list view. + * + * The reach is global on purpose: that is what this addon is for. Uninstall it + * to get the stock Odoo look back. + * + * Note: `:nth-child(even)` counts every `tr` in the `tbody`, not only the data + * rows, so parity can desync in grouped lists or lists carrying an "Add a line" + * row. `:nth-child(even of .o_data_row)` fixes that but needs Chrome 111+ / + * Firefox 113+, which is not a safe assumption for the warehouse tablets. + */ + +table.o_list_table tbody tr.o_data_row:nth-child(even) td { + background-color: rgba(0, 0, 0, 0.03); +} + +table.o_list_table tbody tr.o_data_row:hover td { + background-color: rgba(0, 0, 0, 0.045); +}