diff --git a/website_sale_attribute_filter_category/README.rst b/website_sale_attribute_filter_category/README.rst index 6380632632..f097f09f58 100644 --- a/website_sale_attribute_filter_category/README.rst +++ b/website_sale_attribute_filter_category/README.rst @@ -14,13 +14,13 @@ Website Sale Attribute Filter Category :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github - :target: https://github.com/OCA/e-commerce/tree/11.0/website_sale_attribute_filter_category + :target: https://github.com/OCA/e-commerce/tree/12.0/website_sale_attribute_filter_category :alt: OCA/e-commerce .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_attribute_filter_category + :target: https://translation.odoo-community.org/projects/e-commerce-12-0/e-commerce-12-0-website_sale_attribute_filter_category :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/113/11.0 + :target: https://runbot.odoo-community.org/runbot/113/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -33,6 +33,19 @@ product attributes filter by their categories. .. contents:: :local: +Configuration +============= + +To configure this module, you need to: + +* Go to 'Website > Configuration > Attribute Categories' and create one. +* Go to 'Website > Configuration > Attributes' and create one or more with + this category. +* Go to 'Website > Configuration > Attribute Values' and create more than one + value for this attribute. +* Go to 'Website > Products > Products' and create a product with this + attribute and assign it an attribute value. + Usage ===== @@ -46,7 +59,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -78,6 +91,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/e-commerce `_ project on GitHub. +This module is part of the `OCA/e-commerce `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_sale_attribute_filter_category/__manifest__.py b/website_sale_attribute_filter_category/__manifest__.py index 191e66ca6a..7671d4361a 100644 --- a/website_sale_attribute_filter_category/__manifest__.py +++ b/website_sale_attribute_filter_category/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Website Sale Attribute Filter Category', 'summary': 'Allow group attributes in shop by categories', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'development_status': 'Beta', 'category': 'Website', 'website': 'https://github.com/OCA/e-commerce', @@ -18,7 +18,4 @@ 'views/assets.xml', 'views/templates.xml', ], - 'demo': [ - 'data/demo.xml', - ], } diff --git a/website_sale_attribute_filter_category/data/demo.xml b/website_sale_attribute_filter_category/data/demo.xml deleted file mode 100644 index 3bc13a055f..0000000000 --- a/website_sale_attribute_filter_category/data/demo.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Test Category - - - - - Test - - - - - Test v1 - - - - Test v2 - - - - - - - - - - - - diff --git a/website_sale_attribute_filter_category/readme/CONFIGURE.rst b/website_sale_attribute_filter_category/readme/CONFIGURE.rst new file mode 100644 index 0000000000..6f1f52c7b1 --- /dev/null +++ b/website_sale_attribute_filter_category/readme/CONFIGURE.rst @@ -0,0 +1,9 @@ +To configure this module, you need to: + +* Go to 'Website > Configuration > Attribute Categories' and create one. +* Go to 'Website > Configuration > Attributes' and create one or more with + this category. +* Go to 'Website > Configuration > Attribute Values' and create more than one + value for this attribute. +* Go to 'Website > Products > Products' and create a product with this + attribute and assign it an attribute value. diff --git a/website_sale_attribute_filter_category/static/description/index.html b/website_sale_attribute_filter_category/static/description/index.html index dfd749c12f..eb5b7aa21e 100644 --- a/website_sale_attribute_filter_category/static/description/index.html +++ b/website_sale_attribute_filter_category/static/description/index.html @@ -367,24 +367,38 @@

Website Sale Attribute Filter Category

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/e-commerce Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/e-commerce Translate me on Weblate Try me on Runbot

This module extends the functionality of website sale module to allow to group product attributes filter by their categories.

Table of contents

+
+

Configuration

+

To configure this module, you need to:

+
    +
  • Go to ‘Website > Configuration > Attribute Categories’ and create one.
  • +
  • Go to ‘Website > Configuration > Attributes’ and create one or more with +this category.
  • +
  • Go to ‘Website > Configuration > Attribute Values’ and create more than one +value for this attribute.
  • +
  • Go to ‘Website > Products > Products’ and create a product with this +attribute and assign it an attribute value.
  • +
+
-

Usage

+

Usage

  1. Go to Website Shop.
  2. Active filter by attributes in “Customize” option in top menu.
  3. @@ -392,23 +406,23 @@

    Usage

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/e-commerce project on GitHub.

+

This module is part of the OCA/e-commerce project on GitHub.

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

diff --git a/website_sale_attribute_filter_category/static/src/js/website_sale_attribute_filter_category_tour.js b/website_sale_attribute_filter_category/static/src/js/website_sale_attribute_filter_category_tour.js index 50875db721..007bb61666 100644 --- a/website_sale_attribute_filter_category/static/src/js/website_sale_attribute_filter_category_tour.js +++ b/website_sale_attribute_filter_category/static/src/js/website_sale_attribute_filter_category_tour.js @@ -8,18 +8,12 @@ odoo.define("website_sale_attribute_filter_category.tour", function (require) { var base = require("web_editor.base"); var steps = [ - { - trigger: "a:contains('Customize')", - }, - { - trigger: "a:contains('Product Attribute')", - }, { trigger: "a[href='/shop']", }, { - trigger: "a:contains('iPod')", - extra_trigger: ".js_attributes:has(span:contains('Test Category'))", + trigger: "a:contains('Customizable Desk')", + extra_trigger: ".js_attributes:has(span:contains('Test category'))", }, ]; tour.register("website_sale_attribute_filter_category", diff --git a/website_sale_attribute_filter_category/tests/test_website_sale_attribute_filter_category.py b/website_sale_attribute_filter_category/tests/test_website_sale_attribute_filter_category.py index c0c98b23b2..ff5a6da822 100644 --- a/website_sale_attribute_filter_category/tests/test_website_sale_attribute_filter_category.py +++ b/website_sale_attribute_filter_category/tests/test_website_sale_attribute_filter_category.py @@ -5,13 +5,53 @@ class websiteSaleAttributeFilterCategoryHttpCase(HttpCase): + def setUp(self): + super().setUp() + # Models + AttributeCategory = self.env['product.attribute.category'] + ProductAttribute = self.env['product.attribute'] + ProductAttributeValue = self.env['product.attribute.value'] + ProductAttributeLine = self.env['product.template.attribute.line'] + self.attribute_category = AttributeCategory.create({ + 'name': 'Test category', + }) + self.product_attribute = ProductAttribute.create({ + 'name': 'Test', + 'website_published': True, + 'create_variant': 'no_variant', + 'category_id': self.attribute_category.id, + }) + self.product_attribute_value_test_1 = ProductAttributeValue.create({ + 'name': 'Test v1', + 'attribute_id': self.product_attribute.id, + }) + self.product_attribute_value_test_2 = ProductAttributeValue.create({ + 'name': 'Test v2', + 'attribute_id': self.product_attribute.id, + }) + self.product_template = self.env.ref( + 'product.product_product_4_product_template') + self.product_attribute_line = ProductAttributeLine.create({ + 'product_tmpl_id': self.product_template.id, + 'attribute_id': self.product_attribute.id, + 'value_ids': [(6, 0, + [self.product_attribute_value_test_1.id, + self.product_attribute_value_test_2.id] + )] + }) + self.product_template.write({ + 'attribute_line_ids': [(4, self.product_attribute_line.id)] + }) + # Active attribute's filter in /shop. By default it's disabled. + self.env.ref('website_sale.products_attributes').active = True + def test_ui_website(self): """Test frontend tour.""" tour = ( "odoo.__DEBUG__.services['web_tour.tour']", "website_sale_attribute_filter_category", ) - self.phantom_js( + self.browser_js( url_path="/", code="%s.run('%s')" % tour, ready="%s.tours['%s'].ready" % tour, diff --git a/website_sale_attribute_filter_category/views/templates.xml b/website_sale_attribute_filter_category/views/templates.xml index 2dd062b2e9..0a261f5ee5 100755 --- a/website_sale_attribute_filter_category/views/templates.xml +++ b/website_sale_attribute_filter_category/views/templates.xml @@ -19,7 +19,7 @@ -
    +
      $0