Skip to content

Commit 55ceada

Browse files
committed
[MIG] product_assortment: Migration to 17.0
1 parent 04af4c3 commit 55ceada

File tree

6 files changed

+22
-25
lines changed

6 files changed

+22
-25
lines changed

product_assortment/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Product Assortment
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
20-
:target: https://github.com/OCA/product-attribute/tree/18.0/product_assortment
20+
:target: https://github.com/OCA/product-attribute/tree/17.0/product_assortment
2121
:alt: OCA/product-attribute
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_assortment
23+
:target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_assortment
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=18.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -78,7 +78,7 @@ Bug Tracker
7878
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
7979
In case of trouble, please check there if your issue has already been reported.
8080
If you spotted it first, help us to smash it by providing a detailed and welcomed
81-
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_assortment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
81+
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_assortment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
8282

8383
Do not contact contributors directly about support or help with technical issues.
8484

@@ -114,6 +114,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
114114
mission is to support the collaborative development of Odoo features and
115115
promote its widespread use.
116116

117-
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/18.0/product_assortment>`_ project on GitHub.
117+
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/17.0/product_assortment>`_ project on GitHub.
118118

119119
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

product_assortment/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "Product Assortment",
77
"summary": """
88
Adds the ability to manage products assortment""",
9-
"version": "18.0.1.0.0",
9+
"version": "17.0.1.0.0",
1010
"license": "AGPL-3",
1111
"development_status": "Production/Stable",
1212
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",

product_assortment/models/ir_filters.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,11 @@ def _compute_record_count(self):
142142
record.record_count = self.env[record.model_id].search_count(domain)
143143

144144
@api.model
145-
def _get_action_domain(
146-
self, action_id=None, embedded_action_id=None, embedded_parent_res_id=None
147-
):
145+
def _get_action_domain(self, action_id=None):
148146
# tricky way to act on get_filter method to prevent returning
149147
# assortment in search view filters
150148
domain = super()._get_action_domain(
151149
action_id=action_id,
152-
embedded_action_id=embedded_action_id,
153-
embedded_parent_res_id=embedded_parent_res_id,
154150
)
155151
domain = expression.AND([[("is_assortment", "=", False)], domain])
156152

product_assortment/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Product Assortment</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:af159859935f84f06b57cebf020961a03ba724fd1033627f9796e1843fca60f9
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/18.0/product_assortment"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_assortment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/17.0/product_assortment"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_assortment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This addon intends to manage product assortment. In Odoo you can only
374374
define some filters defined by a domain but it can be sometimes really
375375
complicated. With this addon you will be able to define a domain but
@@ -437,7 +437,7 @@ <h1><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h1>
437437
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-attribute/issues">GitHub Issues</a>.
438438
In case of trouble, please check there if your issue has already been reported.
439439
If you spotted it first, help us to smash it by providing a detailed and welcomed
440-
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_assortment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
440+
<a class="reference external" href="https://github.com/OCA/product-attribute/issues/new?body=module:%20product_assortment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
441441
<p>Do not contact contributors directly about support or help with technical issues.</p>
442442
</div>
443443
<div class="section" id="credits">
@@ -470,7 +470,7 @@ <h2><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h2>
470470
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
471471
mission is to support the collaborative development of Odoo features and
472472
promote its widespread use.</p>
473-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/18.0/product_assortment">OCA/product-attribute</a> project on GitHub.</p>
473+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-attribute/tree/17.0/product_assortment">OCA/product-attribute</a> project on GitHub.</p>
474474
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
475475
</div>
476476
</div>

product_assortment/tests/test_product_assortment.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_product_assortment_view(self):
9191
included_product = self.env.ref("product.product_product_7")
9292
self.assortment.write({"whitelist_product_ids": [(4, included_product.id)]})
9393
res = self.assortment.show_products()
94-
self.assertEqual(res["domain"], [(1, "=", 1)])
94+
self.assertEqual(res["domain"], [("id", "in", [included_product.id])])
9595

9696
def test_product_assortment_view_with_black_list(self):
9797
excluded_product = self.env.ref("product.product_product_7")
@@ -113,7 +113,8 @@ def test_product_assortment_mixed_view(self):
113113
}
114114
)
115115
res = self.assortment.show_products()
116-
self.assertEqual(res["domain"], [("id", "not in", excluded_product.ids)])
116+
self.assertEqual(res["domain"][1], ("id", "not in", excluded_product.ids))
117+
self.assertEqual(res["domain"][2], ("id", "in", included_product.ids))
117118

118119
def test_record_count(self):
119120
products = self.product_obj.search([])

product_assortment/views/product_assortment.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
</search>
1313
</field>
1414
</record>
15-
<record id="product_assortment_view_list" model="ir.ui.view">
15+
<record id="product_assortment_view_tree" model="ir.ui.view">
1616
<field name="model">ir.filters</field>
1717
<field name="arch" type="xml">
18-
<list>
18+
<tree>
1919
<field name="name" />
20-
</list>
20+
</tree>
2121
</field>
2222
</record>
2323

@@ -106,15 +106,15 @@
106106
name="whitelist_product_ids"
107107
nolabel="1"
108108
colspan="2"
109-
context="{'list_view_ref': 'product_assortment.product_product_view_list'}"
109+
context="{'tree_view_ref': 'product_assortment.product_product_view_tree'}"
110110
/>
111111
</group>
112112
<group name="to_exclude" string="Products to exclude">
113113
<field
114114
name="blacklist_product_ids"
115115
nolabel="1"
116116
colspan="2"
117-
context="{'list_view_ref': 'product_assortment.product_product_view_list'}"
117+
context="{'tree_view_ref': 'product_assortment.product_product_view_tree'}"
118118
/>
119119
</group>
120120
</group>
@@ -125,12 +125,12 @@
125125
</form>
126126
</field>
127127
</record>
128-
<record id="product_product_view_list" model="ir.ui.view">
128+
<record id="product_product_view_tree" model="ir.ui.view">
129129
<field name="model">product.product</field>
130130
<field name="arch" type="xml">
131-
<list>
131+
<tree>
132132
<field name="display_name" string="Product" />
133-
</list>
133+
</tree>
134134
</field>
135135
</record>
136136
<record id="actions_product_assortment_view" model="ir.actions.act_window">
@@ -143,7 +143,7 @@
143143
<field
144144
name="view_ids"
145145
eval="[(5, 0, 0),
146-
(0, 0, {'view_mode': 'list', 'view_id': ref('product_assortment_view_list')}),
146+
(0, 0, {'view_mode': 'tree', 'view_id': ref('product_assortment_view_tree')}),
147147
(0, 0, {'view_mode': 'form', 'view_id': ref('product_assortment_view_form')})]"
148148
/>
149149
</record>

0 commit comments

Comments
 (0)