OD328 bundle-template-removed¶
A data file inherits or references an asset bundle, which is no longer a template.
| Category | Severity | Series | Needs the index |
|---|---|---|---|
| Deprecation | Error | saas~14.3 and later | no |
What it reports¶
A reference to web.assets_backend, web.assets_common or web.assets_frontend in a data file
the manifest loads: the inherit_id of a <template>, the ref of a field such as an
ir.ui.view record's inherit_id, or any other XML id the file names. A file the manifest does
not load is left to OD502. OD301 and OD302 report nothing at
an element this rule reports, so another unknown id on it, such as a group in the groups of the
same <template>, shows only once the bundle reference is gone.
Why it matters¶
Up to saas~14.2 the three bundles are QWeb templates of web, and a module adds its scripts and
style sheets by inheriting one with an xpath. From saas~14.3 the bundles exist only as keys of the
manifest's assets, and web defines no view under those ids. The loader turns the inherit_id
into a lookup of the XML id, which fails with "External ID not found", so the module does not
install. Moving the files to assets is the whole fix: the bundle loads them in the order listed.
Modules of saas~14.2 and earlier are not checked, since the templates still exist there.
Example¶
<odoo>
<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/library_loan/static/src/js/loan_badge.js"/>
</xpath>
</template>
</odoo>
The file stops the install from saas~14.3. Delete it, drop it from data, and list the script in
the manifest instead:
{
"name": "Library loans",
"version": "15.0.1.0.0",
"depends": ["web"],
"data": [],
"assets": {
"web.assets_backend": ["library_loan/static/src/js/loan_badge.js"],
},
}