Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions product_brand/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"data": [
"security/ir.model.access.csv",
"views/product_brand_view.xml",
"views/product_product_view.xml",
"reports/sale_report_view.xml",
"reports/account_invoice_report_view.xml",
],
Expand Down
17 changes: 17 additions & 0 deletions product_brand/views/product_product_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="product_view_kanban_catalog" model="ir.ui.view">
<field name="name">product variant kanban catalog view: add brand</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_view_kanban_catalog" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']/.." position="after">
<div>
<a t-if="record.product_brand_id" type="open">
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In kanban QWeb templates, record.<field> is always a field descriptor object, so t-if="record.product_brand_id" will evaluate truthy even when the many2one is unset. Use record.product_brand_id.raw_value (or an equivalent raw/value check) so the brand block is actually hidden when no brand is set.

Suggested change
<a t-if="record.product_brand_id" type="open">
<a t-if="record.product_brand_id.raw_value" type="open">

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do it a link.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¿Can you maybe put a special class to highlight that is a brand?

<field name="product_brand_id" widget="many2one" />
</a>
</div>
</xpath>
</field>
</record>
</odoo>
Loading