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

Open Beginner friendly
#1,187 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
html, python
Domain
backend

Research direction

The fix is in bi_sql_editor/models/bi_sql_view_field.py where _TTYPE_SELECTION needs a new 'html' entry. Open that file, locate the selection list around line 16, and add the html option alongside the existing types. Verify by creating a SQL view with HTML content and checking that it renders formatted in List view instead of as raw text.

Written by the indexing model from the issue text.

Description

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
Dominant language
HTML
Stars
435
Forks
929
Avg merge
6d 18h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OCA/reporting-engine

All issues in OCA/reporting-engine

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.