Skip to content

OD506 assets-qweb-unloaded

The manifest adds files to web.assets_qweb, which Odoo no longer loads.

Category Severity Series Needs the index
Deprecation Warning 16.0 and later no

What it reports

A web.assets_qweb key under the manifest's assets that names a file no other bundle of the manifest lists. A module often keeps the key beside a bundle that already loads the same files, and those templates load, so the rule stays silent there.

Why it matters

From saas~14.3 to saas~15.4 the web client fetches the templates of web.assets_qweb apart from the scripts. From 16.0 a bundle carries the XML of its own files with its scripts, and nothing fetches web.assets_qweb any more. The module installs, but the templates listed there never reach the browser: a component or a widget that renders one fails with a missing template. List the files in the bundle that loads the scripts using them, usually web.assets_backend.

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

Example

__manifest__.py
{
    "name": "Library loans",
    "version": "16.0.1.0.0",
    "depends": ["web"],
    "assets": {
        "web.assets_backend": ["library_loan/static/src/js/**/*"],
        "web.assets_qweb": ["library_loan/static/src/xml/**/*"],
    },
}

From 16.0 the templates never reach the browser, and the components rendering them fail. Move the glob into the bundle that loads the scripts:

__manifest__.py
{
    "name": "Library loans",
    "version": "16.0.1.0.0",
    "depends": ["web"],
    "assets": {
        "web.assets_backend": [
            "library_loan/static/src/js/**/*",
            "library_loan/static/src/xml/**/*",
        ],
    },
}

Suppressing

"web.assets_qweb": ["library_loan/static/src/xml/**/*"],  # odooscan: ignore[OD506]

See suppressing a finding.