Name:
[FWD] forward-port 8 commits from 17.0 (c676d5a..2fe943f)
State:
Killed
PR State:
merged
PR Author:
David Tran
PR Author Email:
PR:
#663
Committer:
David Tran
Committer Email:
davidtran.hp@gmail.com
Commit:
8a99e82cb0abafeb4aa93efa7a05e3a1d8edf571
Description:
[FIX] viin_brand_common+viin_brand_website: make 2fe943f's regression tests pass on 18.0
The two suites forward-ported with 2fe943f failed on their first real 18.0 run.
Two distinct causes, both fixed here.
1. /web/offline was renamed to /odoo/offline at 18.0
(web/controllers/webmanifest.py), so two tests in test_web_layout.py got a
404 and never reached their assertions. Only the TEST was affected -
viin_brand_common's own controller overrides the handler with a bare
@http.route(), inherits core's path, and therefore followed the rename by
itself. The path is now a module-level OFFLINE_URL constant so the next
rename breaks in one obvious place.
2. viin_brand_website's layout carried an 18.0-only override that destroyed the
website's own favicon:
<xpath expr="//t[@t-set='x_icon']" position="replace">
<t t-set="x_icon" t-value="'/viin_brand/static/img/favicon.ico'"/>
</xpath>
locate_node resolves an xpath to the FIRST document-order match, which in the
combined website.layout arch is website's own producer
(t-set x_icon = website.image_url(website, 'favicon')). Replacing it meant a
website that had configured its own favicon could never serve it - the brand
path was substituted unconditionally, with no `or` guard. Adding a guard would
not have helped: after the replace, x_icon is unset at that point, so
`x_icon or <brand>` collapses to the brand every time.
This is why the title survived while the favicon did not: only x_icon had a
second, replace-based mutator. Title flows through website's own
`t-if="not title"` guard untouched.
SCOPE NOTE: that override is NOT one of the eight commits this wave forward-ports
and predates it on 18.0 - 17.0 has no such block. It is removed rather than left
red because the test 2fe943f brings across exists precisely to assert that the
brand default never pre-empts a website's own value, and removing the override
restores the 17.0 behaviour that test encodes. It does change observable
behaviour: a website with its own configured favicon now serves that favicon on
website pages instead of the brand one. Non-website pages are unaffected - they
still take the brand default from viin_brand_common's own fallback. Flagged for
review rather than buried.
Verified: the four affected modules' Python suites now run 22 tests with zero
failures on a live 18.0 build (was 3 failures).
Branch:
18.0
Age:
Up-time:
Not finished