Files
BEYOND/addons/beyond_base/views/login_templates.xml
T
Jorem JuárezandClaude Opus 5 d9b7be34b1 La llave de acceso sale de todas las pantallas
Se revierte la decisión de conservar el bloque de auth_passkey en el
inicio de sesión («it is restyled, not dropped»), y se cierran también el
resto de las puertas visibles:

- Inicio de sesión: replace vacío sobre el `t-call="web.login_oauth"` de
  web.login, que es quien dibuja el «- o -» y el botón; el bloque no está
  en el arch de web.login y un xpath sobre él no engancharía.
- Alta y restablecer contraseña (y cualquier página que llame a
  web.login_oauth): fuera las tres líneas con que auth_passkey añade su
  botón a `auth_btns`; con la lista vacía el t-if del core se lleva el
  separador.
- Ficha del usuario y preferencias: la sección «Llaves de acceso».
- Asistente de confirmar identidad: el modo llave y su botón. Además el
  asistente ya no ARRANCA en ese modo: auth_passkey lo pone por defecto a
  quien tiene una llave, con la contraseña oculta y la salida dentro del
  bloque retirado; sin esto abría una hoja en blanco.
- Portal /my/security: la tabla de llaves y su «Agregar»
  (beyond_attendance_qr).

Todo con replace vacío y prioridad 99, para correr después de las
herencias de auth_passkey sea cual sea el orden de instalación. Por eso
beyond_base depende ahora de auth_passkey y beyond_attendance_qr de
auth_passkey_portal: los nodos que se quitan son suyos.

Solo se esconden las puertas: las llaves registradas NO se borran y los
módulos siguen instalados. Devolverlas es quitar los xpaths y el método
por defecto; views/passkey_templates.xml los lista. El servidor sigue
aceptando un inicio de sesión con llave si alguien lo envía a mano.

El SCSS del login pierde las reglas que vestían el bloque, ya huérfanas.

Sin pruebas nuevas. Verificado instalando los nueve módulos en una base
desechable —todos los xpaths enganchan, sin errores de vista ni de
assets— y revisando cada puerta ahí: ningún nodo de llave, y a un usuario
con llave registrada el asistente le pide contraseña (la capa de
auth_passkey sola pediría la llave). pruebas.sh beyond_base: los mismos
2 rojos que en main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 17:12:27 -06:00

206 lines
11 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--
Beyond — login v1.
The signed-off "Iniciar sesión" screen, built by inheriting web.login
and web.login_layout. No core file is touched and no controller is
overridden: the form that posts to /web/login is Odoo's own, kept whole
with its action, its method, its csrf_token and its redirect. What
changes is the markup around the fields and the shell it renders in.
Both templates carry priority="99" so they are the LAST arch applied to
web.login. auth_signup and auth_passkey also inherit it, and the order
has to be a decision rather than a coincidence of module ids: this file
replaces the block that auth_signup drops its "Restablecer contraseña"
link into, and it can only do that reliably if the link is already
there when it runs. beyond_base depends on auth_signup for the same
reason (see __manifest__.py).
THREE THINGS THE DESIGN ASKS FOR THAT ARE NOT HERE, on purpose:
1. Live validation. The mock decides on its own that the fields are
empty and writes its own message. Here every message is the
server's, after the POST — a wrong password is Odoo's string,
rendered in the design's voice by scss/../login/beyond_login.scss.
The only client-side check left is core's own `required`.
2. The "Bienvenido, X" screen. There is nothing to build: a correct
login is a 303 out of /web/login and the browser lands on the Menú
Principal (the launcher, ADR-005). The mock needed that screen
because it had nowhere to go.
3. The eye's own logic. It lives in login/beyond_login.js, because the
type of an input is not something a template can toggle.
AND THREE THINGS THE DESIGN DID NOT KNOW ABOUT, decided here:
- web.user_switch (Odoo 19) is removed. It is the "Choose a user"
screen that hides the form behind the last accounts to log in on this
browser. On a shop terminal shared by a shift that is a list of
colleagues' names and faces on the pre-session screen, and the design
has no such state.
- The signup link ("¿No tienes una cuenta?") is removed. Beyond staff
are provisioned by the branch administrator (ADR-008); nobody signs
themselves up. NOTE this only takes the link off this screen — the
/web/signup route stays open until `auth_signup.invitation_scope` is
set to b2b in Ajustes.
- The passkey block (auth_passkey) is REMOVED (14-sep-2026), reversing
the earlier decision to keep it restyled, and so is every other
passkey door in the system (views/passkey_templates.xml, which lists
them). Only the doors are hidden: keys already registered are NOT
deleted and auth_passkey stays installed, so bringing them back is
putting the xpaths back. Here it is taken out at its
`t-call="web.login_oauth"`, which renders the "- o -" separator and
every button in `auth_btns` — today only the passkey, since
auth_oauth is not installed.
-->
<!--
The shell. web.login_layout wraps its content in a centred 300px card
with the company logo on top and an "Con la tecnología de Odoo" footer
under it. The login screen is a full-bleed two-column page, so on this
page the card is not overridden, it is not rendered at all.
`beyond_login` is set by the template below, inside the body of the
t-call — QWeb renders that body first and the t-set reaches here. The
other pages that share this layout (restablecer contraseña, alta,
sesión iniciada) never set it and are left exactly as they were.
-->
<template id="login_layout_beyond" inherit_id="web.login_layout" priority="99"
name="Beyond — envoltura de inicio de sesión">
<xpath expr="//t[@t-set='body_classname']" position="attributes">
<attribute name="t-value">'beyond_login_body' if beyond_login else 'bg-100'</attribute>
</xpath>
<xpath expr="//div[hasclass('container')]" position="attributes">
<attribute name="t-if">not beyond_login</attribute>
</xpath>
<xpath expr="//div[hasclass('container')]" position="after">
<div t-if="beyond_login" class="beyond_login">
<div class="beyond_login_brand">
<!--
Absolute path on purpose: this page precedes the
session and resolves nothing through the backend.
20 KB PNG, white type on transparency, from the 1.2 MB
JPEG the design shipped.
-->
<img class="beyond_login_logo" alt="Look Capital"
src="/beyond_base/static/img/logo_login.png"/>
</div>
<div class="beyond_login_panel">
<div class="beyond_login_stack">
<t t-out="0"/>
</div>
</div>
</div>
</xpath>
</template>
<!-- The form itself. -->
<template id="login_beyond" inherit_id="web.login" priority="99"
name="Beyond — iniciar sesión">
<!-- Read by the layout above. `disable_footer` takes out the "Gestionar
bases de datos" and Odoo branding line under the card. -->
<xpath expr="//form[@role='form']" position="before">
<t t-set="beyond_login" t-value="True"/>
<t t-set="disable_footer" t-value="True"/>
<span class="beyond_login_title">Iniciar sesión</span>
</xpath>
<!-- La firma va en inglés en las dos pantallas que la llevan, esta y el
Menú Principal (webclient/beyond_launcher.xml). Es una excepción
deliberada a la regla 4 de CLAUDE.md — «español en toda cadena
visible» —, decidida el 23-ago-2026: es la marca de Collina, no
una cadena de la interfaz, y valía más que fuera la misma en
ambas que traducida en una y no en la otra. Si cambia, cambian
las dos. -->
<xpath expr="//form[@role='form']" position="after">
<span class="beyond_login_sign">Powered by Collina Systems</span>
</xpath>
<!-- See the web.user_switch note at the top of this file. -->
<xpath expr="//owl-component[@name='web.user_switch']" position="replace"/>
<!-- Core hides the form with `d-none` and lets the user switcher decide
whether to show it. With the switcher gone the form is the screen,
so the class stops being computed. -->
<xpath expr="//form[@role='form']" position="attributes">
<attribute name="t-attf-class"/>
<attribute name="class">oe_login_form beyond_login_form</attribute>
</xpath>
<xpath expr="//div[hasclass('field-login')]" position="replace">
<div class="beyond_login_field">
<div class="beyond_login_field_head">
<label for="login" class="beyond_login_label">Nombre de usuario</label>
</div>
<!-- name="login" is what /web/login reads. The design calls it
"Nombre de usuario" because that is what the staff type;
Odoo accepts the login, mail or not. -->
<input type="text" name="login" id="login" class="beyond_login_input"
t-att-value="login" placeholder="Usuario"
required="required" autocapitalize="off" autocomplete="username"
t-att-autofocus="'autofocus' if not login else None"/>
</div>
</xpath>
<!-- The o_caps_lock_warning class rides along: core's interaction hangs
its "¡Bloq Mayús está activado!" off it, which is worth keeping on
a screen where you type blind. -->
<xpath expr="//div[hasclass('o_caps_lock_warning')]" position="replace">
<div class="beyond_login_field o_caps_lock_warning">
<div class="beyond_login_field_head">
<label for="password" class="beyond_login_label">Contraseña</label>
<!-- The real reset route, behind the real switch: Ajustes →
"Restablecer contraseña" (auth_signup.reset_password).
Off, and the link is not rendered — the same condition
core uses, only the copy is the design's. -->
<a t-if="reset_password_enabled" class="beyond_login_forgot"
t-attf-href="/web/reset_password?{{ keep_query() }}">¿Olvidaste tu contraseña?</a>
</div>
<div class="beyond_login_pw">
<input type="password" name="password" id="password"
class="beyond_login_input_pw" placeholder="••••••••••"
required="required" autocomplete="current-password"
maxlength="4096"
t-att-autofocus="'autofocus' if login else None"/>
<button type="button" class="beyond_login_eye"
aria-label="Mostrar contraseña" aria-pressed="false">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path d="M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"
stroke="currentColor" stroke-width="2"/>
<circle cx="12" cy="12" r="3.2" stroke="currentColor" stroke-width="2"/>
</svg>
</button>
</div>
</div>
</xpath>
<!-- The server's own messages, stripped of Bootstrap's alert box so the
design's 14px/700 can show. The text and the t-if stay core's. -->
<xpath expr="//p[hasclass('alert-danger')]" position="attributes">
<attribute name="class">beyond_login_error</attribute>
</xpath>
<xpath expr="//p[hasclass('alert-success')]" position="attributes">
<attribute name="class">beyond_login_message</attribute>
</xpath>
<!-- oe_login_buttons is kept in the class list: auth_signup hangs its
arch off it. -->
<xpath expr="//div[hasclass('oe_login_buttons')]" position="attributes">
<attribute name="class">oe_login_buttons beyond_login_actions</attribute>
</xpath>
<xpath expr="//div[hasclass('oe_login_buttons')]/button[@type='submit']" position="attributes">
<attribute name="class">beyond_login_submit</attribute>
</xpath>
<!-- See the passkey note at the top of this file. The block is not in
web.login's arch: this call renders it, so the call is what goes. -->
<xpath expr="//t[@t-call='web.login_oauth']" position="replace"/>
<!-- See the signup note at the top of this file. -->
<xpath expr="//a[contains(@t-attf-href, '/web/signup')]" position="replace"/>
</template>
</odoo>