[19.0] bi_sql_editor HTML content renders as raw text (not formatted) in Odoo 19 List views

Aperta Adatta ai principianti
#1,187 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
html, python
Ambito
backend

Direzione di ricerca

La correzione si trova in bi_sql_editor/models/bi_sql_view_field.py, dove _TTYPE_SELECTION necessita di una nuova voce 'html'. Apri quel file, individua l'elenco di selezione intorno alla riga 16 e aggiungi l'opzione html accanto ai tipi esistenti. Verifica creando una vista SQL con contenuto HTML e controllando che venga renderizzata formattata nella vista Elenco invece che come testo non formattato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Module

bi_sql_editor

Describe the bug

HTML content in CHAR fields correctly displays with the HTML widget in Odoo 16 but not Odoo 17, Odoo 18 or Odoo 19. This is because in Odoo 17 field widgets are resolved through the fields registry and there's now stricter matching between a widget and the declared field type. When the widget/type pairing doesn't line up the way the registry expects, the List view falls back to the generic/default renderer for the field's actual ttype (char), which just prints the raw string — tags and all.

To Reproduce

Odoo 17, Odoo 18, Odoo 19

Steps to reproduce the behavior:

  1. create a SQL view containing a field with HTML content
  2. create and open the UI in List View
  3. observe the raw rendering of the content

Expected behavior
The content should render as other html fields do with the html widget

Solution
Support the html field type

Add "html" as an option to _TTYPE_SELECTION

https://github.com/OCA/reporting-engine/blob/19.0/bi_sql_editor/models/bi_sql_view_field.py#L16

Image
Lingua principale
HTML
Stelle
435
Fork
929
Merge medio
17g 12h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OCA/reporting-engine

Tutte le issue di OCA/reporting-engine

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.