Skip to content

Commit 67b261f

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

File tree

7 files changed

+47
-38
lines changed

7 files changed

+47
-38
lines changed

product_sticker/README.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,19 @@ be printed or not.
5959
Usage
6060
=====
6161

62-
Go to Settings > Technical > Database Structure > Product Stickers. You
63-
can add Stickers to Attributes resulting in different behaviours: - If
64-
an Image has no Company, it will be available to all Companies - If an
65-
Image has Available Models, it will be restricted to selected Models. -
66-
If an Image has no Attribute, it will be available to all Attributes -
67-
If an Image has no Attribute Value, it will be available to all
68-
Attribute Values of the Attribute - If an Image has no Category, it will
69-
be available to all Categories
70-
71-
You can mix behaviours to create a very flexible sticker system
62+
Go to Settings > Technical > Database Structure > Product Stickers.
63+
64+
You can add Stickers to Attributes resulting in different behaviours:
65+
66+
- If an Image has no Company, it will be available to all Companies.
67+
- If an Image has Available Models, it will be restricted to selected
68+
Models.
69+
- If an Image has no Attribute, it will be available to all Attributes.
70+
- If an Image has no Attribute Value, it will be available to all
71+
Attribute Values of the Attribute.
72+
- If an Image has no Category, it will be available to all Categories.
73+
74+
You can mix behaviours to create a very flexible sticker system.
7275

7376
Bug Tracker
7477
===========

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/readme/USAGE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Go to Settings \> Technical \> Database Structure \> Product Stickers.
2-
You can add Stickers to Attributes resulting in different behaviours: -
3-
If an Image has no Company, it will be available to all Companies - If
4-
an Image has Available Models, it will be restricted to selected
5-
Models. - If an Image has no Attribute, it will be available to all
6-
Attributes - If an Image has no Attribute Value, it will be available to
7-
all Attribute Values of the Attribute - If an Image has no Category, it
8-
will be available to all Categories
92

10-
You can mix behaviours to create a very flexible sticker system
3+
You can add Stickers to Attributes resulting in different behaviours:
4+
- If an Image has no Company, it will be available to all Companies.
5+
- If an Image has Available Models, it will be restricted to selected Models.
6+
- If an Image has no Attribute, it will be available to all Attributes.
7+
- If an Image has no Attribute Value, it will be available to all Attribute Values of the Attribute.
8+
- If an Image has no Category, it will be available to all Categories.
9+
10+
You can mix behaviours to create a very flexible sticker system.

product_sticker/static/description/index.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,18 @@ <h1 class="title">Product Sticker</h1>
403403
</div>
404404
<div class="section" id="usage">
405405
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
406-
<p>Go to Settings &gt; Technical &gt; Database Structure &gt; Product Stickers. You
407-
can add Stickers to Attributes resulting in different behaviours: - If
408-
an Image has no Company, it will be available to all Companies - If an
409-
Image has Available Models, it will be restricted to selected Models. -
410-
If an Image has no Attribute, it will be available to all Attributes -
411-
If an Image has no Attribute Value, it will be available to all
412-
Attribute Values of the Attribute - If an Image has no Category, it will
413-
be available to all Categories</p>
414-
<p>You can mix behaviours to create a very flexible sticker system</p>
406+
<p>Go to Settings &gt; Technical &gt; Database Structure &gt; Product Stickers.</p>
407+
<p>You can add Stickers to Attributes resulting in different behaviours:</p>
408+
<ul class="simple">
409+
<li>If an Image has no Company, it will be available to all Companies.</li>
410+
<li>If an Image has Available Models, it will be restricted to selected
411+
Models.</li>
412+
<li>If an Image has no Attribute, it will be available to all Attributes.</li>
413+
<li>If an Image has no Attribute Value, it will be available to all
414+
Attribute Values of the Attribute.</li>
415+
<li>If an Image has no Category, it will be available to all Categories.</li>
416+
</ul>
417+
<p>You can mix behaviours to create a very flexible sticker system.</p>
415418
</div>
416419
<div class="section" id="bug-tracker">
417420
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>

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)