Skip to content
Snippets Groups Projects
Commit bfadb8e4 authored by Victor Piryns (pivi)'s avatar Victor Piryns (pivi)
Browse files

[FIX] board: not crash on views with domains and custom layout


Current behaviour:
If you export a view with a (some) filters and you set a custom
layout in the dashboard, you will get a traceback, preventing
you for accessing your newly exported dashboard.

Expected behaviour:
Should not crash when trying to view your exported view,
even with a custom domain.

Steps to reproduce:
- Install Dashboard, Sales
- Export from Sales > List View with a filter Creation Date before
  XX:XX (date is irrelevant)
- Go to Dashboard > My Dashboard > Change Layout to something else
- Exit the page and retry to reopen it, a stacktrace is shown.

Reason for the problem:
When preprocessing the arch of the view in the dashboard, which is an
xml string, there is the domain included, which contains symbols that
are unparsable by `etree` unless escaped (like `<`).

Fix:
Escape the domain client side before being sent and saved in the database,
so when requesting it we don't have a parsing error. Then we unescape it when
the clients reads the domain from the server. The unescaping before
escaping is to avoid problem of double escaping when changing subsequently
the layout of the board view.

Affected versions:
- 16.0
- saas-16.1
- master

opw-3130117

closes odoo/odoo#110662

Signed-off-by: default avatarGéry Debongnie <ged@odoo.com>
parent a3f6cefb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment