[19.0][IMP] product_brand: add brand into kanban catalog view#300
[19.0][IMP] product_brand: add brand into kanban catalog view#300matiasperalta1 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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_catalogto displayproduct_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"> |
There was a problem hiding this comment.
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.
| <a t-if="record.product_brand_id" type="open"> | |
| <a t-if="record.product_brand_id.raw_value" type="open"> |
|
Hi @pedrobaeza, could you check this? |
| <field name="arch" type="xml"> | ||
| <xpath expr="//field[@name='name']/.." position="after"> | ||
| <div> | ||
| <a t-if="record.product_brand_id" type="open"> |
| <field name="arch" type="xml"> | ||
| <xpath expr="//field[@name='name']/.." position="after"> | ||
| <div> | ||
| <a t-if="record.product_brand_id" type="open"> |
There was a problem hiding this comment.
¿Can you maybe put a special class to highlight that is a brand?
No description provided.