Conversation
A server-rendered QWeb element that carries `class` beside `t-att-class` or `t-attf-class` keeps only the dynamic one. QWeb compiles the static attributes and the dynamic ones into the same `attrs` dictionary, the static first, so the dynamic value replaces the whole `class` key and the static classes never reach the page. Nothing reports it. The view combines, the page answers 200 and the element is in the DOM, only without the classes meant to style it, so it surfaces as a layout that stopped applying for no visible reason. It is also what an inheritance produces on its own: `<attribute name="class" remove="..."/>` silently stops removing anything the day upstream turns that static `class` into a `t-attf-class`. The check reports only the classes the dynamic value does not spell out. One written in both places still renders, and flagging it would report code that works. Templates declared under `assets` or `qweb` are skipped: Owl compiles those in the browser and its `setClass` calls `classList.add`, so there the two attributes combine rather than one replacing the other. Measured with this check over installed addons: 14 elements in odoo/addons 19.0 (633 modules) and 10 in enterprise (785 modules) drop a class this way, among them `mt-2` on the event registration questions and `btn-check` on a survey scale input. Nine OCA repositories (166 modules) report none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A server-rendered QWeb element that carries
classbesidet-att-classort-attf-classkeeps only the dynamic one. QWeb compiles the static attributes and the dynamic ones into the sameattrsdictionary, the static first, so the dynamic value replaces the wholeclasskey and the static classes never reach the page.Nothing reports it. The view combines, the page answers 200 and the element is in the DOM, only without the classes meant to style it, so it surfaces as a layout that stopped applying for no visible reason. It is also what an inheritance produces on its own:
<attribute name="class" remove="..."/>silently stops removing anything the day upstream turns that staticclassinto at-attf-class.The check reports only the classes the dynamic value does not spell out. One written in both places still renders, and flagging it would report code that works. Templates declared under
assetsorqwebare skipped: Owl compiles those in the browser and itssetClasscallsclassList.add, so there the two attributes combine rather than one replacing the other.Measured with this check over installed addons: 14 elements in odoo/addons 19.0 (633 modules) and 10 in enterprise (785 modules) drop a class this way, among them
mt-2on the event registration questions andbtn-checkon a survey scale input. Nine OCA repositories (166 modules) report none.