OD326 kanban-box-renamed-card¶
The kanban-box template of a kanban view is renamed card.
| Category | Severity | Series | Needs the index |
|---|---|---|---|
| Deprecation | Warning, Error from saas~18.1 | 18.0 and later | no |
What it reports¶
An element with t-name="kanban-box" that a view's arch adds, in a kanban view or in the kanban
subview of an x2many field, when that kanban defines no card template. A spec that locates the
parent's kanban-box is not reported, and neither is a QWeb view, which the server renders.
Why it matters¶
Odoo 18.0 renamed the template a kanban view draws each record with from kanban-box to card.
On 18.0, a kanban arch without a card template still falls back to kanban-box and logs a
warning in the browser console. From saas~18.1 the fallback is gone: opening the view fails with
Missing 'card' template., so the menu or the x2many field that shows it no longer loads. The
install itself succeeds, since the server does not compile kanban archs. A kanban that also
defines card loads on every series, which draw card and never read kanban-box.
A card template is the card itself, so the <div> that wrapped the content of kanban-box,
with its oe_kanban_global_click class, is no longer needed. Modules before 18.0 are not
checked, since kanban-box is the only name those series know.
Example¶
<record id="view_partner_category_kanban_segments" model="ir.ui.view">
<field name="name">res.partner.category.kanban.segments</field>
<field name="model">res.partner.category</field>
<field name="arch" type="xml">
<kanban>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<field name="name"/>
</div>
</t>
</templates>
</kanban>
</field>
</record>
The view's only template is kanban-box, which saas~18.1 no longer looks for.
<record id="view_partner_category_kanban_segments" model="ir.ui.view">
<field name="name">res.partner.category.kanban.segments</field>
<field name="model">res.partner.category</field>
<field name="arch" type="xml">
<kanban>
<templates>
<t t-name="card">
<field name="name"/>
</t>
</templates>
</kanban>
</field>
</record>