Name:
[FIX] viin_brand_common: anchor web.layout xpaths on //head so core's QUnit guard can run again
State:
Failed
finished in 80m
PR State:
merged
PR Author:
David Tran
PR Author Email:
PR:
#661
Committer:
David Tran
Committer Email:
david.tran@tvtmarine.com
Commit:
acc54740be59a8bcf683c4f7f96dd57eb13754f7
Description:
[FIX] viin_brand_common: anchor web.layout xpaths on //head, not //title/link
Core's WebSuite.test_check_suite (web/tests/test_js.py::_check_only_call)
replaces web.layout's entire arch_db with a minimal stand-in arch that has
a <head> but no <title>/<link>, to validate no stray QUnit.only()/
QUnit.debug() was left in the JS test suite. Writing that stand-in fires
ir.ui.view's arch_db constraint, which recombines every view inheriting
web.layout - viin_brand_common's two xpaths (anchored on //title and
//link[@type='image/x-icon']) cannot locate their anchor against the
stand-in, raising ValidationError and leaving core's QUnit-guard dead on
every Viindoo 17 database.
Replace both element-anchored xpaths with a single xpath anchored on
//head (which the stand-in does provide), inserting two <t t-set> nodes
as previous siblings of <head> that set the `title`/`x_icon` QWeb
variables to their Viindoo defaults via an `or` fallback chain
(`title or 'Viindoo'`, `x_icon or '/viin_brand/static/img/favicon.ico'`).
Core's own <title t-esc="title or 'Odoo'"/> and favicon
<link t-att-href="x_icon or '/web/static/img/favicon.ico'"/> then pick up
those pre-set values unchanged, so exactly one <title> renders and an
explicit caller-supplied title/x_icon still wins.
Bump version 0.3.1 -> 0.3.2 so existing databases reload arch_db on
upgrade.
Add tests/test_web_layout.py (wired into tests/__init__.py) with 4
HttpCase regression tests covering: survival of core's exact stub write
(RED before this fix), default title/favicon still brand correctly with
exactly one <title>, an explicit title still wins, and an explicit
x_icon still wins. All 4 assert on rendered HTTP output, never the arch
string.
Close https://github.com/Viindoo/branding/issues/654
Branch:
17.0
Age:
Up-time: