From 71e0c85b0a47d4813c7c60e2d31be16967334c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Sun, 23 Aug 2026 21:19:53 -0600 Subject: [PATCH] =?UTF-8?q?Integra=20la=20pantalla=20de=20inicio=20de=20se?= =?UTF-8?q?si=C3=B3n=20v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Traducción fiel del diseño aprobado, por herencia de web.login y web.login_layout. Cero core: el
que postea a /web/login sigue siendo el de Odoo, entero, con su action, su method, su csrf_token y su redirect; lo que cambia es el markup alrededor de los campos y la envoltura donde se pinta. Las dos plantillas llevan priority="99" para aplicarse SIEMPRE al final: auth_signup y auth_passkey también heredan web.login, y el orden tenía que ser una decisión y no una casualidad de ids. De ahí la dependencia explícita de auth_signup. Tres cosas del diseño que no se implementan, a propósito: - La validación en vivo. Todo mensaje es del servidor, después del POST; el

de Odoo conserva texto y condición y solo pierde la caja alert de Bootstrap para tomar los 14px/700 #C55A22 del diseño. - La pantalla "Bienvenido, X". Un login correcto es una redirección y el usuario cae en el Menú Principal (ADR-005). La maqueta la necesitaba porque no tenía a dónde ir. - El min(360px, 72%) del logo, escrito como width + max-width: Sass evalúa un min() pelado y se niega a comparar px con %. El ancho usado es idéntico. Tres cosas que el diseño no conocía, decididas aquí: - web.user_switch (nuevo en Odoo 19) se retira. Escondía el formulario tras un "Elige un usuario" con las últimas cuentas de ese navegador: en una terminal de turno compartido eso es la lista de nombres y caras de los compañeros, antes de la sesión. - El enlace de alta pública se retira. Al personal lo da de alta la administración (ADR-008). - El bloque de llaves de acceso (auth_passkey) se queda, revestido al lenguaje del diseño. No estaba en la maqueta, pero es una vía real de entrada y quitarlo dejaría fuera a quien ya registró una. Toque >= 48px sin mover el diseño: el ojo se pinta 44x44 y lleva un área táctil invisible de 48x48 centrada. Foco solo en :focus-visible, con el anillo repuesto a mano porque `all: unset` se lleva el del navegador. Todo el SCSS va anidado bajo .beyond_login / .beyond_login_body: el paquete frontend lo carga cada página pública, incluido el portal del empleado, y ni una regla puede escaparse. El kiosco QR queda fuera de alcance por construcción, es una plantilla que no llama a ningún paquete. Co-Authored-By: Claude Opus 5 (1M context) --- addons/beyond_base/__manifest__.py | 19 +- .../static/src/login/beyond_login.js | 44 ++ .../static/src/login/beyond_login.scss | 500 ++++++++++++++++++ addons/beyond_base/views/login_templates.xml | 188 +++++++ 4 files changed, 747 insertions(+), 4 deletions(-) create mode 100644 addons/beyond_base/static/src/login/beyond_login.js create mode 100644 addons/beyond_base/static/src/login/beyond_login.scss create mode 100644 addons/beyond_base/views/login_templates.xml diff --git a/addons/beyond_base/__manifest__.py b/addons/beyond_base/__manifest__.py index 5cd497d..01278b1 100644 --- a/addons/beyond_base/__manifest__.py +++ b/addons/beyond_base/__manifest__.py @@ -9,24 +9,28 @@ Cimientos del sistema Beyond (BRIEF §4 y §6): administrador de sucursal y empleado. Las reglas de registro (ir.rule) que aíslan datos por sucursal llegan en Fase 1 junto con beyond_branch. - Branding: nombre "Beyond" de la instancia, identidad visual v1 definida - por Collina (paleta y tipografía Manrope autoalojada) y el lanzador de - aplicaciones a pantalla completa (ADR-005). + por Collina (paleta y tipografía Manrope autoalojada), el lanzador de + aplicaciones a pantalla completa (ADR-005) y la pantalla de inicio de + sesión, que hereda web.login sin tocar ni el formulario ni la ruta. Depende de hr/hr_attendance porque el rol "empleado" se define sobre empleados y asistencias, y las ir.rule de Fase 1 para esos modelos -vivirán en este módulo. +vivirán en este módulo. Depende de auth_signup (LGPL, el core lo +auto-instala igual) para fijar el orden de herencia sobre web.login: el +enlace de "¿Olvidaste tu contraseña?" es el suyo, con su condición real. """, 'version': '19.0.0.1.0', 'category': 'Beyond', 'author': 'Collina Systems', 'license': 'Other proprietary', - 'depends': ['base', 'web', 'hr', 'hr_attendance'], + 'depends': ['base', 'web', 'auth_signup', 'hr', 'hr_attendance'], 'data': [ 'security/beyond_security.xml', 'data/branding.xml', 'data/bootstrap_admin.xml', 'data/menu_cleanup.xml', 'data/idioma.xml', + 'views/login_templates.xml', ], 'demo': [ 'demo/demo_empleados.xml', @@ -41,6 +45,13 @@ vivirán en este módulo. 'beyond_base/static/src/webclient/beyond_launcher.js', 'beyond_base/static/src/webclient/beyond_launcher.xml', ], + # The login screen renders before there is a session: it gets the + # frontend bundle and nothing else, so the face travels with it. + 'web.assets_frontend': [ + 'beyond_base/static/src/scss/beyond_fonts.scss', + 'beyond_base/static/src/login/beyond_login.scss', + 'beyond_base/static/src/login/beyond_login.js', + ], }, 'installable': True, 'application': False, diff --git a/addons/beyond_base/static/src/login/beyond_login.js b/addons/beyond_base/static/src/login/beyond_login.js new file mode 100644 index 0000000..d3754d1 --- /dev/null +++ b/addons/beyond_base/static/src/login/beyond_login.js @@ -0,0 +1,44 @@ +/** + * Beyond — login v1: the eye that shows the password. + * + * Core ships this behaviour (web/static/src/public/show_password.js) but it is + * bound to a Bootstrap `.input-group` wrapping a `.o_show_password` button with + * a Font Awesome icon, and it says nothing to a screen reader. The login screen + * uses the design's own pill and its own SVG, so the toggle is rewritten here — + * eight lines and the ARIA that core leaves out. + * + * Deliberately a plain script and not an Interaction: this runs on the page + * that precedes the session, where the less machinery involved in reaching the + * password field, the better. It touches nothing but the input's `type`. + * + * Not touched: the form, its action, its method or the csrf_token. + */ +(function () { + "use strict"; + + // Spanish, like every string a user reads (CLAUDE.md). + const LABEL_SHOW = "Mostrar contraseña"; + const LABEL_HIDE = "Ocultar contraseña"; + + function setUpPasswordToggle() { + const eye = document.querySelector(".beyond_login .beyond_login_eye"); + const password = document.querySelector(".beyond_login #password"); + if (!eye || !password) { + return; + } + eye.addEventListener("click", function () { + const wasVisible = password.type === "text"; + password.type = wasVisible ? "password" : "text"; + eye.setAttribute("aria-pressed", String(!wasVisible)); + eye.setAttribute("aria-label", wasVisible ? LABEL_SHOW : LABEL_HIDE); + // Back to typing where the user left off, not on the button. + password.focus(); + }); + } + + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", setUpPasswordToggle); + } else { + setUpPasswordToggle(); + } +})(); diff --git a/addons/beyond_base/static/src/login/beyond_login.scss b/addons/beyond_base/static/src/login/beyond_login.scss new file mode 100644 index 0000000..d785afd --- /dev/null +++ b/addons/beyond_base/static/src/login/beyond_login.scss @@ -0,0 +1,500 @@ +// ============================================================================= +// Beyond — login v1 +// +// Faithful translation of the signed-off "Iniciar sesión" (login_v1.html). +// Every colour, radius, size, gap, duration and font weight below is copied +// from that file, unrounded; the rules that have no counterpart there are +// marked ENGINEERING and say what they protect against — the design only +// covers the nominal case, and this one sits on top of Odoo's real login form. +// +// SCOPE — everything is nested under .beyond_login / .beyond_login_body. This +// file rides web.assets_frontend, which every public page loads (the employee +// portal of beyond_attendance_qr among them), so not one rule may escape the +// login screen. The QR kiosk is a standalone template that calls no +// bundle at all and is out of reach by construction. +// +// PALETTE — the surfaces and the ink are the identity's own tokens; the design +// reuses them exactly. The black is NOT: the design paints the controls +// #191613 instead of the brand green, deliberately, so the pre-session screen +// reads as the product's cover rather than as another green ERP form. Per the +// rule written in scss/beyond_variables.scss ("a colour graduates to a token +// when a SECOND screen needs it") that black, the field white, the placeholder +// grey and the eye's hover stay local variables here. So does the error +// orange, even though it is byte-for-byte the launcher's "Panel General": +// same hex, unrelated meaning. +// ============================================================================= + +// The control black of the login and its hover/pressed states. +$beyond-login-ink: #191613; +$beyond-login-ink-hover: #33302B; +$beyond-login-ink-active: #000000; + +// The brand panel behind the logo — flat black, not the ink above. +$beyond-login-brand-bg: #000000; + +// Fields +$beyond-login-field-bg: #FFFFFF; +$beyond-login-placeholder: #B3ADA3; +$beyond-login-eye-hover: #F0EEE8; + +// The focus ring the design draws around a field in focus. +$beyond-login-ring: rgba(25, 22, 19, 0.10); + +// Error text. Same hex as $beyond-launcher-panel and unrelated to it. +$beyond-login-error: #C55A22; + +// ----------------------------------------------------------------------------- +// Page +// +// ENGINEERING — the class replaces Odoo's `bg-100` on rather than +// joining it (see views/login_templates.xml): the utility paints the body with +// !important and there is no point in an override war on a page we own whole. +// ----------------------------------------------------------------------------- +.beyond_login_body { + margin: 0; + padding: 0; + background: $beyond-surface; + color: $beyond-ink; + font-family: $beyond-font-family; + -webkit-font-smoothing: antialiased; + overflow: hidden; // the design is 100vh with no scroll +} + +.beyond_login { + height: 100vh; + display: flex; + background: $beyond-surface; + color: $beyond-ink; + overflow: hidden; + + // --------------------------------------------------------------------- + // Left: the brand panel + // --------------------------------------------------------------------- + .beyond_login_brand { + flex: 1 1 46%; + min-width: 0; + background: $beyond-login-brand-bg; + display: flex; + align-items: center; + justify-content: center; + padding: 56px; + } + + .beyond_login_logo { + display: block; + // The design says `width: min(360px, 72%)`. Written as a pair because + // Sass evaluates a bare min() itself and refuses to compare px with %; + // the used width is identical. + width: 72%; + max-width: 360px; + height: auto; + } + + // --------------------------------------------------------------------- + // Right: the form + // --------------------------------------------------------------------- + .beyond_login_panel { + flex: 1 1 54%; + min-width: 0; + display: flex; + justify-content: center; + padding: 40px; + overflow-y: auto; + } + + .beyond_login_stack { + box-sizing: border-box; + width: 100%; + max-width: 440px; + margin: auto; + display: flex; + flex-direction: column; + gap: 26px; + } + + // ENGINEERING — web.login ships two empty `oe_structure` drop zones around + // the form. Empty flex children still eat a 26px gap each, so they are + // hidden while empty and left alone the moment anything is dropped in. + .oe_structure:empty { + display: none; + } + + .beyond_login_title { + font-size: 34px; + font-weight: 800; + letter-spacing: -0.03em; + color: $beyond-ink; + } + + // The form is a column on the same 26px rhythm as the stack around it, so + // title / user / password / CTA / error / signature read as one list. + .beyond_login_form { + display: flex; + flex-direction: column; + gap: 26px; + } + + // ENGINEERING — the database picker is core's, shown only when the server + // serves more than one database. It keeps its Bootstrap look (a developer + // sees it, an employee never does); all it needs is to stop fighting the + // column's own rhythm with a utility margin. + .beyond_login_form > .mb-3 { + margin-bottom: 0 !important; + } + + // --------------------------------------------------------------------- + // Fields + // --------------------------------------------------------------------- + .beyond_login_field { + display: flex; + flex-direction: column; + gap: 8px; + } + + .beyond_login_field_head { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 12px; + } + + .beyond_login_label { + margin: 0; // ENGINEERING — Bootstrap's reboot puts a margin on