Skip to content

Commit

Permalink
[MIG] brand: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Jan 2, 2025
1 parent 933c31e commit 662e61f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion brand/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This is a base addon for brand modules. It adds the brand object and
its menu and define an abstract model to be inherited from branded
objects""",
"version": "17.0.1.1.1",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "Odoo Community Association (OCA), ACSONE SA/NV",
"website": "https://github.com/OCA/brand",
Expand Down
2 changes: 1 addition & 1 deletion brand/models/res_brand_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _get_view(self, view_id=None, view_type="form", **options):
"""set visibility and requirement rules"""
arch, view = super()._get_view(view_id, view_type, **options)
if self.env["res.brand"].check_access_rights("read", raise_exception=False):
if view.type in ["form", "tree"]:
if view.type in ["form", "list"]:
brand_node = next(
iter(
arch.xpath(
Expand Down
20 changes: 8 additions & 12 deletions brand/views/res_brand.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,15 @@
<field name="image_128" />
<field name="type" />
<templates>
<t t-name="kanban-box">
<t t-name="card">
<div
class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban"
class=" o_kanban_record_has_image_fill o_res_partner_kanban"
>
<t
t-set="placeholder"
t-value="'/base/static/img/company_image.png'"
/>
<div
class="o_kanban_image_fill_left o_kanban_image_full"
t-attf-style="background-image: url(#{kanban_image('res.brand', 'image_128', record.id.raw_value, placeholder)})"
role="img"
/>
<field name="image_128" widget="image" options="{'img_class': 'object-fit-cover'}"/>
<div class="oe_kanban_details d-flex flex-column">
<strong
class="o_kanban_record_title oe_partner_heading"
Expand Down Expand Up @@ -173,21 +169,21 @@
</kanban>
</field>
</record>
<record model="ir.ui.view" id="res_brand_tree_view">
<field name="name">res.brand.tree (in partner_brand)</field>
<record model="ir.ui.view" id="res_brand_list_view">
<field name="name">res.brand.list (in partner_brand)</field>
<field name="model">res.brand</field>
<field name="inherit_id" ref="base.view_partner_tree" />
<field name="inherit_id" ref="base.view_partner_list" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<xpath expr="//list" position="attributes">
<attribute name="string">Brands</attribute>
</xpath>
</field>
</record>
<record model="ir.actions.act_window" id="res_brand_act_window">
<field name="name">Brands</field>
<field name="res_model">res.brand</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_mode">kanban,list,form</field>
<field name="context">{'default_customer': 0, 'default_supplier': 0,}
</field>
</record>
Expand Down

0 comments on commit 662e61f

Please sign in to comment.