Skip to content

[19.0][IMP] product_brand: add brand into kanban catalog view#300

Open
matiasperalta1 wants to merge 1 commit into
OCA:19.0from
adhoc-dev:19.0-h-109998-mnp
Open

[19.0][IMP] product_brand: add brand into kanban catalog view#300
matiasperalta1 wants to merge 1 commit into
OCA:19.0from
adhoc-dev:19.0-h-109998-mnp

Conversation

@matiasperalta1
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 30, 2026 18:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds the product brand field to the product variant kanban “catalog” view in the product_brand addon, so users can see a product’s brand directly in that catalog card UI.

Changes:

  • Introduces a new inherited view extending product.product_view_kanban_catalog to display product_brand_id.
  • Loads the new view via the module manifest.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
product_brand/views/product_product_view.xml Inherits the product variant kanban catalog view and injects a brand display block.
product_brand/manifest.py Registers the new XML view file for loading.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

<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
Contributor

@lef-adhoc lef-adhoc left a comment

Choose a reason for hiding this comment

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

LGTM

@lef-adhoc
Copy link
Copy Markdown
Contributor

Hi @pedrobaeza, could you check this?

@pedrobaeza pedrobaeza changed the title [IMP] product_brand: add brand into kanban catalog view [19.0][IMP] product_brand: add brand into kanban catalog view May 1, 2026
@pedrobaeza pedrobaeza added this to the 19.0 milestone May 1, 2026
<field name="arch" type="xml">
<xpath expr="//field[@name='name']/.." position="after">
<div>
<a t-if="record.product_brand_id" type="open">
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.

<field name="arch" type="xml">
<xpath expr="//field[@name='name']/.." position="after">
<div>
<a t-if="record.product_brand_id" type="open">
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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants