Skip to content

OD505 qweb-key-ignored

The manifest lists templates under qweb, which Odoo ignores.

Category Severity Series Needs the index
Deprecation Warning saas~14.3 and later no

What it reports

A qweb key of the manifest that names a file no bundle giving templates lists. Before 16.0 that bundle is web.assets_qweb, which the message names as the place to list the files; from 16.0 it is any other bundle, and the message names web.assets_backend. A module often keeps the key beside the bundle that already loads the same files, and those templates load, so the rule stays silent there.

Why it matters

Up to saas~14.2 the web client fetches the templates of every file the qweb key lists. From saas~14.3 it reads the templates of the web.assets_qweb bundle alone, and nothing reads the key any more. The module installs, but its client templates never reach the browser: a widget or a dialog that renders one fails with a missing template. From 16.0 web.assets_qweb is not loaded either (see OD506), and a bundle such as web.assets_backend carries the templates with its scripts.

Modules of saas~14.2 and earlier are not checked, since the key still loads there.

Example

__manifest__.py
{
    "name": "Library loans",
    "version": "15.0.1.0.0",
    "depends": ["web"],
    "qweb": ["static/src/xml/loan_badge.xml"],
}

From saas~14.3 the badge template never reaches the browser, and the widget rendering it fails. List the file under web.assets_qweb instead:

__manifest__.py
{
    "name": "Library loans",
    "version": "15.0.1.0.0",
    "depends": ["web"],
    "assets": {
        "web.assets_qweb": ["library_loan/static/src/xml/loan_badge.xml"],
    },
}

Suppressing

"qweb": ["static/src/xml/loan_badge.xml"],  # odooscan: ignore[OD505]

See suppressing a finding.