Skip to content
Snippets Groups Projects
Commit 63ba2317 authored by Romain Derie's avatar Romain Derie
Browse files

[FIX] website: get the error view without parsing the view tree


Before this commit:
The `if` condition doing a `View._views_get` was supposed to be a sort of
'hack' for when the error occured in a child view (as the template raised would
be the parent, not the broken child).
But since we refactored that part to use etree, it was actually going into that
condition for every error even if the error was in the called template.
Proof is, we only set `editable` in that if condition, meaning going in the
else would actually prevent to show reset template.

Indeed the following code would always be true:
   et = etree.fromstring(view.with_context(inherit_branding=False).read_combined(['arch'])['arch'])
   node = et.find(exception.path.replace('/templates/t/', './'))
as read_combined returns all the view hierarchy DOM

Note: We could not fix this by checking exception.path against `arch` as we
could have false positive (eg the child view replace the <p> element by another
<p> element which is broken, then the path would be found in the parent view
even if the error was in the child view).

closes odoo/odoo#31515

Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
parent 9d4aad2d
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