Skip to content

Commit f6ded6f

Browse files
committed
[MIG] product_sticker: Migration to 18.0
1 parent b62f9da commit f6ded6f

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

product_sticker/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Product Sticker",
6-
"version": "16.0.3.0.0",
6+
"version": "18.0.1.0.0",
77
"author": "Moduon, Odoo Community Association (OCA)",
88
"license": "AGPL-3",
99
"website": "https://github.com/OCA/product-attribute",

product_sticker/models/product_sticker.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ProductSticker(models.Model):
2121
max_width=64,
2222
max_height=64,
2323
store=True,
24+
string="Small Image",
2425
)
2526
image_size = fields.Selection(
2627
selection=[
@@ -91,7 +92,9 @@ def _onchange_product_attribute_value_id(self):
9192
if self.product_attribute_value_id:
9293
return {
9394
"value": {
94-
"product_attribute_id": self.product_attribute_value_id.attribute_id.id
95+
"product_attribute_id": (
96+
self.product_attribute_value_id.attribute_id.id
97+
),
9598
},
9699
}
97100
return {}
@@ -209,4 +212,4 @@ def _get_stickers(self, products, extra_domain=None):
209212
attributes=no_variant_attribute_lines.attribute_id | pp_pavs.attribute_id,
210213
attribute_values=no_variant_attribute_lines.value_ids | pp_pavs,
211214
)
212-
return self.search(expression.AND([product_sticker_domain, extra_domain]))
215+
return self.search(expression.AND([product_sticker_domain, extra_domain or []]))

product_sticker/views/product_attribute_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<field name="sticker_count" widget="statinfo" string="Stickers" />
1717
</button>
1818
</xpath>
19-
<xpath expr="//field[@name='value_ids']/tree" position="inside">
19+
<xpath expr="//field[@name='value_ids']/list" position="inside">
2020
<field name="sticker_count" string="Stickers" />
2121
</xpath>
2222
</field>

product_sticker/views/product_sticker_views.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<record id="action_product_sticker" model="ir.actions.act_window">
44
<field name="name">Product Stickers</field>
55
<field name="res_model">product.sticker</field>
6-
<field name="view_mode">kanban,tree,form</field>
6+
<field name="view_mode">kanban,list,form</field>
77
</record>
88

99
<record id="product_sticker_form_view" model="ir.ui.view">
@@ -53,7 +53,7 @@
5353
name="note"
5454
colspan="2"
5555
nolabel="1"
56-
attrs="{'invisible': [('show_sticker_note', '=', False)]}"
56+
invisible="not show_sticker_note"
5757
placeholder="Sticker note that goes below image"
5858
/>
5959
</group>
@@ -72,11 +72,11 @@
7272
</field>
7373
</record>
7474

75-
<record id="product_sticker_tree_view" model="ir.ui.view">
76-
<field name="name">product.sticker.form.view</field>
75+
<record id="product_sticker_list_view" model="ir.ui.view">
76+
<field name="name">product.sticker.list.view</field>
7777
<field name="model">product.sticker</field>
7878
<field name="arch" type="xml">
79-
<tree multi_edit="1">
79+
<list multi_edit="1">
8080
<field name="sequence" widget="handle" />
8181
<field name="name" />
8282
<field name="available_model_ids" widget="many2many_tags" />
@@ -96,7 +96,7 @@
9696
optional="hide"
9797
/>
9898
<field name="show_sticker_note" optional="hide" />
99-
</tree>
99+
</list>
100100
</field>
101101
</record>
102102

@@ -120,7 +120,7 @@
120120
<field name="company_id" />
121121
<field name="show_sticker_note" />
122122
<templates>
123-
<t t-name="kanban-box">
123+
<t t-name="card">
124124
<div
125125
class="oe_kanban_global_area oe_kanban_global_click o_kanban_attachment"
126126
>

0 commit comments

Comments
 (0)