Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] website_sale_product_attribute_filter_category: Migration to version 17.0 #1033

Open
wants to merge 22 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
10bb9ee
[11.0][ADD] website_sale_attribute_filter_category: New module
sergio-teruel Mar 20, 2019
7d8b875
[MIG] website_sale_attribute_filter_category: Migration to 12.0
sergio-teruel Oct 22, 2019
c15ef7d
Added translation using Weblate (Finnish)
Mar 16, 2020
f6caeeb
[MIG] website_sale_attribute_filter_category: Migration to v13
CarlosRoca13 May 25, 2020
83a9edc
[MIG] website_sale_attribute_filter_category: Migration to v13. Add c…
sergio-teruel Jun 22, 2020
2f7a8e3
[IMP] website_sale_attribute_filter_category: Use sass instead of les…
mamcode Jun 29, 2020
36ffe3b
[FIX] website_sale_attribute_filter_category: Proper development_status
pedrobaeza Nov 6, 2020
bde93f7
Added translation using Weblate (Dutch)
bosd Dec 15, 2020
6bf4cbc
Added translation using Weblate (Catalan)
claudiagn Feb 25, 2021
9f7a670
Translated using Weblate (Spanish)
claudiagn Feb 25, 2021
4c641b3
[IMP] website_sale_attribute_filter_category: Collapsible attributes
CarlosRoca13 May 10, 2021
11c2e79
[FIX] website_sale_attribute_filter_category: Collapse show
CarlosRoca13 May 10, 2021
01efb11
Translated using Weblate (Catalan)
Noel000 Mar 2, 2022
059c4f4
[MIG] website_sale_attribute_filter_category > website_sale_product_a…
pilarvargas-tecnativa Jan 16, 2023
8fe647a
[FIX] website_sale_attribute_filter_category: Removed products_attrib…
pilarvargas-tecnativa Jan 26, 2023
3c4f9e5
[FIX] website_sale_attribute_filter_category: Added configuration opt…
pilarvargas-tecnativa Feb 2, 2023
2f5dcce
Update translation files
weblate Feb 3, 2023
1d2eb32
Translated using Weblate (Spanish)
Ivorra78 Jul 5, 2023
de7d02b
[UPD] README.rst
OCA-git-bot Sep 3, 2023
c0823b8
Update translation files
weblate Oct 9, 2023
28dae36
[IMP] website_sale_product_attribute_filter_category: pre-commit auto…
carlos-lopez-tecnativa Mar 11, 2025
cbee1d6
[MIG] website_sale_product_attribute_filter_category: Migration to ve…
carlos-lopez-tecnativa Mar 11, 2025
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
108 changes: 108 additions & 0 deletions website_sale_product_attribute_filter_category/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
======================================
Website Sale Attribute Filter Category
======================================

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

.. |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/licence-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/17.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-17-0/e-commerce-17-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=17.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. Also you can select
if you want display folded or unfolded category in website attribute's
filter.

**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.
- Under the ``Customize`` tab, locate the ``Attributes`` section and
enable the ``Group by categories`` option.
- 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:%2017.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/17.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
28 changes: 28 additions & 0 deletions website_sale_product_attribute_filter_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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": "17.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/snippets/snippets.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"
],
},
}
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
29 changes: 29 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,29 @@
# Copyright 2019 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, http

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


class ProductAttributeCategory(WebsiteSale):
@http.route()
def shop(self, page=0, category=None, search="", ppg=False, **post):
response = super().shop(
page=page, category=category, search=search, ppg=ppg, **post
)
# 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, _("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("attrib", 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: 2022-03-02 12:17+0000\n"
"Last-Translator: Noel estudillo <[email protected]>\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 4.3.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: 2023-07-05 14:08+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\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 4.17\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: 2020-03-16 13:13+0000\n"
"Last-Translator: Retropikzel <[email protected]>\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 3.10\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"
47 changes: 47 additions & 0 deletions website_sale_product_attribute_filter_category/i18n/nl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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: 2021-04-05 18:46+0000\n"
"Last-Translator: Bosd <[email protected]>\n"
"Language-Team: none\n"
"Language: nl\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 4.3.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 "Product attribuut categorie"

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

#. 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 "Website ingevouwen"

#~ 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>Filter op categorie</span>"
Loading