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
0f13e7a
[IMP] : black, isort, prettier
CarlosRoca13 Jun 2, 2020
ba37cd6
[MIG] website_sale_product_attribute_value_filter_existing: Migration…
CarlosRoca13 Jun 2, 2020
9e6ec9b
[FIX] website_sale_product_attribute_value_filter_existing: developme…
sbidoul Oct 18, 2020
65cfcc9
Added translation using Weblate (Spanish)
claudiagn Feb 25, 2021
37993a5
Added translation using Weblate (Catalan)
claudiagn Feb 25, 2021
76a9da3
Added translation using Weblate (Dutch)
bosd Apr 5, 2021
9c0bbc4
[IMP] website_sale_product_attribute_value_filter_existing: black, is…
miguel-S73 Jun 25, 2021
1c52531
[MIG] website_sale_product_attribute_value_filter_existing: Migration…
miguel-S73 Jun 25, 2021
ca4cbfe
[IMP] website_sale_product_attribute_value_filter_existing: black, is…
CarlosRoca13 Nov 2, 2022
e083f2f
[MIG] website_sale_product_attribute_value_filter_existing: Migration…
CarlosRoca13 Nov 2, 2022
4042615
[16.0][MIG] website_sale_product_attribute_value_filter_existing: Mig…
anothingguy Mar 24, 2023
dc8a8d5
[FIX] website_sale_product_attribute_value_filter_existing: match sig…
HekkiMelody May 10, 2023
c52425d
website_sale_product_attribute_value_filter_existing 16.0.1.0.1
OCA-git-bot May 11, 2023
193ad5b
[FIX] website_sale_product_attribute_value_filter_existing: fix test …
pilarvargas-tecnativa Oct 20, 2023
64327f3
[IMP] website_sale_product_attribute_value_filter_existing: test perf…
josep-tecnativa Oct 18, 2023
e0343b0
Added translation using Weblate (Italian)
mymage May 8, 2024
f3584cd
[IMP] website_sale_product_attribute_value_filter_existing: adds filt…
lef-adhoc Jun 6, 2024
314e579
[FIX] website_sale_product_attribute_value_filter_existing: Hide attr…
pilarvargas-tecnativa Sep 12, 2024
cd38bcf
[IMP] website_sale_product_attribute_value_filter_existing: pre-commi…
pilarvargas-tecnativa Oct 23, 2024
decd2cb
[MIG] website_sale_product_attribute_value_filter_existing: Migration…
pilarvargas-tecnativa Oct 23, 2024
b06b45e
[UPD] Update website_sale_product_attribute_value_filter_existing.pot
Oct 28, 2024
bada8ea
[BOT] post-merge updates
OCA-git-bot Oct 28, 2024
695fe4d
[FIX] website_sale_product_attribute_value_filter_existing: Hide attr…
pilarvargas-tecnativa Oct 28, 2024
262f6c7
Update translation files
weblate Oct 28, 2024
6e5266e
[BOT] post-merge updates
OCA-git-bot Oct 28, 2024
4486451
Added translation using Weblate (Turkish)
bo-eska Jun 19, 2025
340c902
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Jun 30, 2025
88c34b6
[IMP] website_sale_product_attribute_value_filter_existing: improve p…
pilarvargas-tecnativa Nov 24, 2025
033c5b4
[BOT] post-merge updates
OCA-git-bot Nov 24, 2025
0a6e743
[MIG] website_sale_product_attribute_value_filter_existing: Migration…
ALopez-Adhoc Jan 9, 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
96 changes: 96 additions & 0 deletions website_sale_product_attribute_value_filter_existing/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.. 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 Value Existing
=====================================

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

.. |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-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-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_value_filter_existing
: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_value_filter_existing
: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
hide product attributes values which exist but not used on any variants.

**Table of contents**

.. contents::
:local:

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_value_filter_existing%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>`__:

- Victor M.M. Torres
- Sergio Teruel
- Carlos Roca
- Pilar Vargas

- `Trobz <https://trobz.com>`__:

- Hoang Diep <hoang@trobz.com>

Other credits
-------------

The migration of this module from 15.0 to 16.0 was financially supported
by Camptocamp

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_value_filter_existing>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import controllers
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2019 Tecnativa - Victor M.M. Torres
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
"name": "Website Sale Attribute Value Existing",
"summary": "Allow hide attributes values not used in variants",
"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": "LGPL-3",
"application": False,
"installable": True,
"depends": [
"website_sale",
],
"data": ["views/templates.xml"],
"assets": {
"web.assets_tests": [
"/website_sale_product_attribute_value_filter_existing/static/src/js/"
"website_sale_product_attribute_value_filter_existing_tour.esm.js",
"/website_sale_product_attribute_value_filter_existing/static/src/js/"
Comment on lines +20 to +22
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The web.assets_tests entries use leading / absolute paths and point to static/src/js. In this repo, other addons register test tours via module-relative static/tests/**/* globs (no leading slash). Using absolute paths / a different folder risks the tours not being loaded by the test asset bundle. Consider moving tours under static/tests/tours/ and registering them with a module-relative glob (or at least drop the leading /).

Suggested change
"/website_sale_product_attribute_value_filter_existing/static/src/js/"
"website_sale_product_attribute_value_filter_existing_tour.esm.js",
"/website_sale_product_attribute_value_filter_existing/static/src/js/"
"website_sale_product_attribute_value_filter_existing/static/src/js/"
"website_sale_product_attribute_value_filter_existing_tour.esm.js",
"website_sale_product_attribute_value_filter_existing/static/src/js/"

Copilot uses AI. Check for mistakes.
"website_sale_product_attribute_value_filter_existing_search_desk_tour.esm.js",
]
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from . import main
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2019 Tecnativa - Sergio Teruel
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.http import request

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


class ProductAttributeValues(WebsiteSale):
def _get_additional_shop_values(self, values, **post):
res = super()._get_additional_shop_values(values, **post)
search_product = values.get("search_product")
attributes = values.get("attributes")
if search_product and attributes:
ProductTemplateAttributeLine = request.env[
Comment on lines +9 to +14
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attr_values_used_ids is only added to res when both search_product and attributes are truthy. The inherited QWeb templates always reference attr_values_used_ids, so in cases like an empty result set (or any path where these keys are falsy) this can raise a QWeb rendering error due to an undefined variable. Set a default in res (e.g., False/empty) before the conditional, and then override it when you can compute used values.

Copilot uses AI. Check for mistakes.
"product.template.attribute.line"
]
lines = ProductTemplateAttributeLine.search_read(
domain=[
("product_tmpl_id", "in", search_product.ids),
("attribute_id", "in", attributes.ids),
("attribute_id.visibility", "=", "visible"),
],
fields=["value_ids"],
)
used_value_ids = {
value_id for line in lines for value_id in line.get("value_ids", [])
}
res["attr_values_used_ids"] = used_value_ids
return res
Empty file.
Empty file.
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions website_sale_product_attribute_value_filter_existing/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: pt_BR\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"
14 changes: 14 additions & 0 deletions website_sale_product_attribute_value_filter_existing/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: tr\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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* Go to Website Shop
* Active product attributes filter on theme panel option of shopping page
- Click edit button on shopping page (or directly go url: http://{your-domain}/@/shop)
- On tab `Customize`, enable attributes filter to show attribute values left of the layout.
* System only display the attribute values if used.
Comment on lines +1 to +5
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration text has multiple grammar issues (e.g., "Active" vs "Activate", "System only display"). Please correct wording to be clear and professional for end users.

Suggested change
* Go to Website Shop
* Active product attributes filter on theme panel option of shopping page
- Click edit button on shopping page (or directly go url: http://{your-domain}/@/shop)
- On tab `Customize`, enable attributes filter to show attribute values left of the layout.
* System only display the attribute values if used.
* Go to the Website Shop.
* Activate the product attribute filter in the theme panel options on the shopping page.
- Click the Edit button on the shopping page (or go directly to the URL: http://{your-domain}/@/shop).
- On the `Customize` tab, enable the attribute filter to show attribute values on the left side of the layout.
* The system displays only the attribute values that are in use.

Copilot uses AI. Check for mistakes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- [Tecnativa](https://www.tecnativa.com):
- Victor M.M. Torres
- Sergio Teruel
- Carlos Roca
- Pilar Vargas

- [Trobz](https://trobz.com):
- Hoang Diep \<<hoang@trobz.com>\>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 15.0 to 16.0 was financially supported
by Camptocamp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends the functionality of website sale module to allow
hide product attributes values which exist but not used on any variants.
Comment on lines +1 to +2
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar in the module description is off (e.g., "to allow hide" / "values which exist but not used"). Please rephrase to something like "to hide product attribute values that exist but are not used on any variants" for clarity.

Suggested change
This module extends the functionality of website sale module to allow
hide product attributes values which exist but not used on any variants.
This module extends the functionality of the website sale module to hide
product attribute values that exist but are not used on any variants.

Copilot uses AI. Check for mistakes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading