Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ad3ea07
[11.0][ADD] website_sale_attribute_filter_category: New module
sergio-teruel Mar 20, 2019
0e7e842
[MIG] website_sale_attribute_filter_category: Migration to 12.0
sergio-teruel Oct 22, 2019
9e87bb3
Added translation using Weblate (Finnish)
Mar 16, 2020
826ad61
[MIG] website_sale_attribute_filter_category: Migration to v13
CarlosRoca13 May 25, 2020
16fa969
[MIG] website_sale_attribute_filter_category: Migration to v13. Add c…
sergio-teruel Jun 22, 2020
d1686b2
[IMP] website_sale_attribute_filter_category: Use sass instead of les…
mamcode Jun 29, 2020
f04c980
[FIX] website_sale_attribute_filter_category: Proper development_status
pedrobaeza Nov 6, 2020
70ad80d
Added translation using Weblate (Dutch)
bosd Dec 15, 2020
43ea0fc
Added translation using Weblate (Catalan)
claudiagn Feb 25, 2021
7706a4f
Translated using Weblate (Spanish)
claudiagn Feb 25, 2021
0cf7198
[IMP] website_sale_attribute_filter_category: Collapsible attributes
CarlosRoca13 May 10, 2021
8bd0578
[FIX] website_sale_attribute_filter_category: Collapse show
CarlosRoca13 May 10, 2021
7795bba
Translated using Weblate (Catalan)
Noel000 Mar 2, 2022
a01f598
[MIG] website_sale_attribute_filter_category > website_sale_product_a…
pilarvargas-tecnativa Jan 16, 2023
93672e4
[FIX] website_sale_attribute_filter_category: Removed products_attrib…
pilarvargas-tecnativa Jan 26, 2023
d69ac10
[FIX] website_sale_attribute_filter_category: Added configuration opt…
pilarvargas-tecnativa Feb 2, 2023
abf7b31
Translated using Weblate (Spanish)
Ivorra78 Jul 5, 2023
37208ed
[IMP] website_sale_product_attribute_filter_category: pre-commit auto…
carlos-lopez-tecnativa Mar 11, 2025
41286cc
[MIG] website_sale_product_attribute_filter_category: Migration to ve…
carlos-lopez-tecnativa Mar 11, 2025
faad37b
Added translation using Weblate (Italian)
mymage Apr 2, 2025
eb2784b
[IMP] website_sale_product_attribute_filter_category: pre-commit auto…
pilarvargas-tecnativa Oct 29, 2025
bcd0408
[MIG] website_sale_product_attribute_filter_category: Migration to ve…
pilarvargas-tecnativa Oct 29, 2025
6193f63
[FIX] website_sale_product_attribute_filter_category: Update method a…
pilarvargas-tecnativa Nov 20, 2025
afa1a31
Translated using Weblate (Dutch)
weblate Feb 25, 2026
5aa7979
Translated using Weblate (Catalan)
weblate Feb 25, 2026
2f875a1
Translated using Weblate (Spanish)
weblate Feb 25, 2026
6a020b1
Translated using Weblate (Finnish)
weblate Feb 25, 2026
440f2ac
Translated using Weblate (Italian)
weblate Feb 25, 2026
2978acf
[FIX] website_sale_*: remove deprecated test key from tour
pilarvargas-tecnativa Jul 21, 2026
071e01f
[MIG] website_sale_product_attribute_filter_category: Migration to 19.0
cristina-hidalgo-tecnativa Aug 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions website_sale_product_attribute_filter_category/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================================
Website Sale Attribute Filter Category
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:accb5aeffb5f4d844a1a31065a3ac123e36e6a6c5abb6305b99c21c3780df5c0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
: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/19.0/website_sale_product_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-19-0/e-commerce-19-0-website_sale_product_attribute_filter_category
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

- Go to ``Website \> eCommerce \> Products \> Attribute Categories`` and
create one. You can select if you want display it folded or unfolded
in website.
- Go to ``Website \> eCommerce \> Products \> Attributes``, create one
or more with this category and add more than one value for each
attribute.
- Go to ``Website \> eCommerce \> Products \> Products`` and create a
product with this attribute and assign it an attribute value.

Usage
=====

- Go to the Website Shop.
- Activate the website editor in the top right corner.
- Click on the products list area to open its options in the side panel.
- In the ``Filters`` row, select ``Sidebar`` or ``Off-screen Menu``
(attribute filters must be enabled).
- Enable the ``Group by categories`` option that appears below.
- You should now see the product attribute filters grouped by
categories.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_product_attribute_filter_category%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Sergio Teruel
- Carlos Roca
- Pilar Vargas
- Carlos Lopez

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_attribute_filter_category>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions website_sale_product_attribute_filter_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import controllers
from . import models
30 changes: 30 additions & 0 deletions website_sale_product_attribute_filter_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2019 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Website Sale Attribute Filter Category",
"summary": "Allow group attributes in shop by categories",
"version": "19.0.1.0.0",
"development_status": "Production/Stable",
"category": "Website",
"website": "https://github.com/OCA/e-commerce",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["website_sale_comparison"],
"data": [
"views/templates.xml",
"views/website_sale_product_attribute_filter_category_view.xml",
],
"assets": {
"web.assets_frontend": [
"/website_sale_product_attribute_filter_category/static/src/scss/*.scss",
],
"web.assets_tests": [
"/website_sale_product_attribute_filter_category/static/tests/tours/*.esm.js"
],
"website.website_builder_assets": [
"/website_sale_product_attribute_filter_category/static/src/website_builder/**/*",
],
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import main
50 changes: 50 additions & 0 deletions website_sale_product_attribute_filter_category/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2019 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import http
from odoo.http import request

from odoo.addons.website_sale.controllers.main import WebsiteSale


class ProductAttributeCategory(WebsiteSale):
@http.route()
def shop(
self,
page=0,
category=None,
search="",
min_price=0.0,
max_price=0.0,
tags="",
**post,
):
response = super().shop(
page=page,
category=category,
search=search,
min_price=min_price,
max_price=max_price,
tags=tags,
**post,
)
if "attributes" not in response.qcontext:
# `shop()` can return an early redirect (ecommerce access check,
# legacy category-in-query redirect, another module's override...)
# instead of the rendered "website_sale.products" response.
return response
# Re-order attributes by their category sequence
response.qcontext["attributes"] = response.qcontext["attributes"].sorted(
lambda x: (x.category_id.sequence, x.id)
)
# Load all categories, and load a "False" category for attributes that
# has not category and display it under 'Undefined' category
categories = [(False, request.env._("Undefined"), True)]
categories.extend(
(x.id, x.name, x.website_folded)
for x in response.qcontext["attributes"].mapped("category_id")
)
response.qcontext["attribute_categories"] = categories
response.qcontext["filtered_products"] = False
if search or post.get("attribute_values", False):
response.qcontext["filtered_products"] = True
return response
49 changes: 49 additions & 0 deletions website_sale_product_attribute_filter_category/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_attribute_filter_category
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-02-25 07:28+0000\n"
"Last-Translator: Anonymous <noreply@weblate.org>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: website_sale_product_attribute_filter_category
#: model_terms:ir.ui.view,arch_db:website_sale_product_attribute_filter_category.products_attributes_categories
msgid ""
"<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
" <span>Filters by category</span>"
msgstr ""
"<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
" <span>Filtra per categoria</span>"

#. module: website_sale_product_attribute_filter_category
#: model:ir.model,name:website_sale_product_attribute_filter_category.model_product_attribute_category
msgid "Product Attribute Category"
msgstr "Categoria d'atribut de producte"

#. module: website_sale_product_attribute_filter_category
#: code:addons/website_sale_product_attribute_filter_category/controllers/main.py:0
#, python-format
msgid "Undefined"
msgstr "Indefinit"

#. module: website_sale_product_attribute_filter_category
#: model:ir.model.fields,field_description:website_sale_product_attribute_filter_category.field_product_attribute_category__website_folded
msgid "Website folded"
msgstr "Lloc web plegat"

#~ msgid ""
#~ "<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
#~ " <span>Filters by category</span>"
#~ msgstr ""
#~ "<i class = \"fa fa-filter\" aria-hidden = \"true\" />\n"
#~ " <span> Filtres per categoria </span>"
51 changes: 51 additions & 0 deletions website_sale_product_attribute_filter_category/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_attribute_filter_category
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-17 13:05+0000\n"
"PO-Revision-Date: 2026-02-25 07:29+0000\n"
"Last-Translator: Anonymous <noreply@weblate.org>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: website_sale_product_attribute_filter_category
#: model_terms:ir.ui.view,arch_db:website_sale_product_attribute_filter_category.products_attributes_categories
msgid ""
"<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
" <span>Filters by category</span>"
msgstr ""
"<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
" <span>Filtros por categoría</"
"span>"

#. module: website_sale_product_attribute_filter_category
#: model:ir.model,name:website_sale_product_attribute_filter_category.model_product_attribute_category
msgid "Product Attribute Category"
msgstr "Categoría de atributo de producto"

#. module: website_sale_product_attribute_filter_category
#: code:addons/website_sale_product_attribute_filter_category/controllers/main.py:0
#, python-format
msgid "Undefined"
msgstr "Indefinido"

#. module: website_sale_product_attribute_filter_category
#: model:ir.model.fields,field_description:website_sale_product_attribute_filter_category.field_product_attribute_category__website_folded
msgid "Website folded"
msgstr "Sitio web plegado"

#~ msgid ""
#~ "<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
#~ " <span>Filters by category</span>"
#~ msgstr ""
#~ "<i class = \"fa fa-filter\" aria-hidden = \"true\" />\n"
#~ " <span> Filtra por categoría </span>"
60 changes: 60 additions & 0 deletions website_sale_product_attribute_filter_category/i18n/fi.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_attribute_filter_category
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-02-25 07:29+0000\n"
"Last-Translator: Anonymous <noreply@weblate.org>\n"
"Language-Team: none\n"
"Language: fi\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: website_sale_product_attribute_filter_category
#: model_terms:ir.ui.view,arch_db:website_sale_product_attribute_filter_category.products_attributes_categories
msgid ""
"<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
" <span>Filters by category</span>"
msgstr ""

#. module: website_sale_product_attribute_filter_category
#: model:ir.model,name:website_sale_product_attribute_filter_category.model_product_attribute_category
msgid "Product Attribute Category"
msgstr ""

#. module: website_sale_product_attribute_filter_category
#: code:addons/website_sale_product_attribute_filter_category/controllers/main.py:0
#, python-format
msgid "Undefined"
msgstr "Määrittelemätön"

#. module: website_sale_product_attribute_filter_category
#: model:ir.model.fields,field_description:website_sale_product_attribute_filter_category.field_product_attribute_category__website_folded
msgid "Website folded"
msgstr ""

#, fuzzy
#~ msgid ""
#~ "<i class=\"fa fa-filter\" aria-hidden=\"true\"/>\n"
#~ " <span>Filters by category</span>"
#~ msgstr ""
#~ "<i class=\"fa fa-filter\" aria-hidden=\"true\"/> <span>Filtterit "
#~ "kategorioittain</span>"

#~ msgid "Test"
#~ msgstr "Testi"

#~ msgid "Test Category"
#~ msgstr "Testi Kategoria"

#~ msgid "Test v1"
#~ msgstr "Testi v1"

#~ msgid "Test v2"
#~ msgstr "Testi v2"
Loading
Loading