Skip to content

Commit 5721fd4

Browse files
ALopez-Adhocaugusto-weiss
authored andcommitted
[MIG] website_sale_product_attribute_value_filter_existing: Migration to 19.0
1 parent 033c5b4 commit 5721fd4

11 files changed

Lines changed: 84 additions & 44 deletions

website_sale_product_attribute_value_filter_existing/README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Website Sale Attribute Value Existing
2121
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
2222
:alt: License: LGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github
24-
:target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_product_attribute_value_filter_existing
24+
:target: https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_attribute_value_filter_existing
2525
:alt: OCA/e-commerce
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_product_attribute_value_filter_existing
27+
:target: https://translation.odoo-community.org/projects/e-commerce-19-0/e-commerce-19-0-website_sale_product_attribute_value_filter_existing
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -46,7 +46,7 @@ Bug Tracker
4646
Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
4747
In case of trouble, please check there if your issue has already been reported.
4848
If you spotted it first, help us to smash it by providing a detailed and welcomed
49-
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_attribute_value_filter_existing%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
49+
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_attribute_value_filter_existing%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5050

5151
Do not contact contributors directly about support or help with technical issues.
5252

@@ -91,6 +91,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
9191
mission is to support the collaborative development of Odoo features and
9292
promote its widespread use.
9393

94-
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/18.0/website_sale_product_attribute_value_filter_existing>`_ project on GitHub.
94+
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_attribute_value_filter_existing>`_ project on GitHub.
9595

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

website_sale_product_attribute_value_filter_existing/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Website Sale Attribute Value Existing",
55
"summary": "Allow hide attributes values not used in variants",
6-
"version": "18.0.1.1.1",
6+
"version": "19.0.1.0.0",
77
"development_status": "Production/Stable",
88
"category": "Website",
99
"website": "https://github.com/OCA/e-commerce",

website_sale_product_attribute_value_filter_existing/controllers/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77

88
class ProductAttributeValues(WebsiteSale):
9-
def _get_additional_extra_shop_values(self, values, **post):
10-
res = super()._get_additional_extra_shop_values(values, **post)
9+
def _get_additional_shop_values(self, values, **post):
10+
res = super()._get_additional_shop_values(values, **post)
1111
search_product = values.get("search_product")
1212
attributes = values.get("attributes")
1313
if search_product and attributes:

website_sale_product_attribute_value_filter_existing/i18n/pt_BR.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
msgid ""
55
msgstr ""
6-
"Project-Id-Version: Odoo Server 18.0\n"
6+
"Project-Id-Version: Odoo Server 19.0\n"
77
"Report-Msgid-Bugs-To: \n"
88
"Last-Translator: Automatically generated\n"
99
"Language-Team: none\n"

website_sale_product_attribute_value_filter_existing/i18n/tr.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
msgid ""
55
msgstr ""
6-
"Project-Id-Version: Odoo Server 18.0\n"
6+
"Project-Id-Version: Odoo Server 19.0\n"
77
"Report-Msgid-Bugs-To: \n"
88
"Last-Translator: Automatically generated\n"
99
"Language-Team: none\n"

website_sale_product_attribute_value_filter_existing/i18n/website_sale_product_attribute_value_filter_existing.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
msgid ""
55
msgstr ""
6-
"Project-Id-Version: Odoo Server 18.0\n"
6+
"Project-Id-Version: Odoo Server 19.0\n"
77
"Report-Msgid-Bugs-To: \n"
88
"Last-Translator: \n"
99
"Language-Team: \n"

website_sale_product_attribute_value_filter_existing/static/description/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Website Sale Attribute Value Existing</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:14c186cd0049982173f1eb3e968492d33187543aee78ee73658f1e9d0fdb377a
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/e-commerce/tree/18.0/website_sale_product_attribute_value_filter_existing"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_product_attribute_value_filter_existing"><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/e-commerce&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_attribute_value_filter_existing"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/e-commerce-19-0/e-commerce-19-0-website_sale_product_attribute_value_filter_existing"><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/e-commerce&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>This module extends the functionality of website sale module to allow
379379
hide product attributes values which exist but not used on any variants.</p>
380380
<p><strong>Table of contents</strong></p>
@@ -395,7 +395,7 @@ <h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
395395
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/e-commerce/issues">GitHub Issues</a>.
396396
In case of trouble, please check there if your issue has already been reported.
397397
If you spotted it first, help us to smash it by providing a detailed and welcomed
398-
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_attribute_value_filter_existing%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
398+
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_attribute_value_filter_existing%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
399399
<p>Do not contact contributors directly about support or help with technical issues.</p>
400400
</div>
401401
<div class="section" id="credits">
@@ -436,7 +436,7 @@ <h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
436436
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
437437
mission is to support the collaborative development of Odoo features and
438438
promote its widespread use.</p>
439-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/18.0/website_sale_product_attribute_value_filter_existing">OCA/e-commerce</a> project on GitHub.</p>
439+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_attribute_value_filter_existing">OCA/e-commerce</a> project on GitHub.</p>
440440
<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>
441441
</div>
442442
</div>

website_sale_product_attribute_value_filter_existing/static/src/js/website_sale_product_attribute_value_filter_existing_search_desk_tour.esm.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
/** @odoo-module **/
2-
31
import {registry} from "@web/core/registry";
42

53
registry
64
.category("web_tour.tours")
75
.add("website_sale_product_attribute_value_filter_existing_search_desk", {
8-
url: "/shop?search=customizable",
6+
url: "/shop?search=Test+Product+1",
97
steps: () => [
108
// After searching, the attributes "test red" and "test green" must be present.
11-
// "Test yelow" should not be present as it is not used in any product and
9+
// "Test yellow" should not be present as it is not used in any product and
1210
// "test blue" should not be present as it is not used in the products shown.
1311
{
1412
content:

website_sale_product_attribute_value_filter_existing/static/src/js/website_sale_product_attribute_value_filter_existing_tour.esm.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/** @odoo-module **/
2-
31
import {registry} from "@web/core/registry";
42

53
registry

website_sale_product_attribute_value_filter_existing/tests/test_website_sale_product_attribute_value_filter_existing.py

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,25 @@ def setUpClass(cls):
5151
"html_color": "#FDEA01",
5252
}
5353
)
54-
cls.product_template = cls.env.ref("product.product_product_4_product_template")
54+
# Demo data not available in v19, create test products
55+
ProductTemplate = cls.env["product.template"]
56+
cls.product_template = ProductTemplate.create(
57+
{
58+
"name": "Test Product 1",
59+
"sale_ok": True,
60+
"is_published": True,
61+
"list_price": 100.0,
62+
}
63+
)
64+
cls.product_template_2 = ProductTemplate.create(
65+
{
66+
"name": "Test Product 2",
67+
"sale_ok": True,
68+
"is_published": True,
69+
"list_price": 200.0,
70+
}
71+
)
72+
5573
cls.product_attribute_line = ProductAttributeLine.create(
5674
{
5775
"product_tmpl_id": cls.product_template.id,
@@ -71,12 +89,9 @@ def setUpClass(cls):
7189
cls.product_template.write(
7290
{"attribute_line_ids": [(4, cls.product_attribute_line.id)]}
7391
)
74-
cls.product_template_11 = cls.env.ref(
75-
"product.product_product_11_product_template"
76-
)
77-
cls.product_attribute_line_11 = ProductAttributeLine.create(
92+
cls.product_attribute_line_2 = ProductAttributeLine.create(
7893
{
79-
"product_tmpl_id": cls.product_template_11.id,
94+
"product_tmpl_id": cls.product_template_2.id,
8095
"attribute_id": cls.product_attribute.id,
8196
"value_ids": [
8297
(
@@ -90,19 +105,27 @@ def setUpClass(cls):
90105
],
91106
}
92107
)
93-
cls.product_template_11.write(
94-
{"attribute_line_ids": [(4, cls.product_attribute_line_11.id)]}
108+
cls.product_template_2.write(
109+
{"attribute_line_ids": [(4, cls.product_attribute_line_2.id)]}
95110
)
96111
# Active attribute's filter in /shop. By default it's disabled.
97112
cls.env.ref("website_sale.products_attributes").active = True
113+
cls.env.ref("website_sale.search").active = True
114+
website = cls.env["website"].get_current_website()
115+
cls.env["website"].with_context(website_id=website.id).viewref(
116+
"website_sale.products_attributes"
117+
).active = True
118+
cls.env["website"].with_context(website_id=website.id).viewref(
119+
"website_sale.search"
120+
).active = True
98121

99122
def test_ui_website(self):
100123
# This test ensures that unused attributes are not visible in the filter panel.
101124
self.start_tour(
102125
"/",
103126
"website_sale_product_attribute_value_filter_existing",
104127
login="admin",
105-
# deplay step here to ensure the tests pass
128+
# delay step here to ensure the tests pass
106129
step_delay=100,
107130
)
108131

@@ -113,6 +136,6 @@ def test_ui_website_search_desk(self):
113136
"/",
114137
"website_sale_product_attribute_value_filter_existing_search_desk",
115138
login="admin",
116-
# deplay step here to ensure the tests pass
139+
# delay step here to ensure the tests pass
117140
step_delay=100,
118141
)

0 commit comments

Comments
 (0)