-
-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
21 changed files
with
901 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
==================================== | ||
Website Sale - Hide Empty Categories | ||
==================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:d10828f104845b192f732918c09e56ca4f937bdf26b3cbec8ffec7a10267befb | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-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/18.0/website_sale_hide_empty_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-18-0/e-commerce-18-0-website_sale_hide_empty_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=18.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Removes any category links from the Shop which have no products | ||
associated to them. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
When the module is installed, by default the options to hide empty | ||
categories are active. | ||
|
||
These options can be configured in the web editor. To do this, go to | ||
‘/shop’ and activate or deactivate the options to hide empty categories | ||
from the web editor in the ‘Customize’ tab. | ||
|
||
There are two options: | ||
|
||
- Hide Empty Category Filmstrip: to hide/show empty categories in the | ||
top category bar. | ||
- Hide Empty Category list: to hide/show empty categories in the left | ||
category list. | ||
|
||
Usage | ||
===== | ||
|
||
Once this module is installed and configured, go to ‘/shop’. Empty | ||
categories will not be show. | ||
|
||
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_hide_empty_category%0Aversion:%2018.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 | ||
------- | ||
|
||
* LasLabs | ||
|
||
Contributors | ||
------------ | ||
|
||
- Ted Salmon <[email protected]> | ||
- `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
- Carlos Roca | ||
- Pilar Vargas | ||
|
||
- Radovan Skolnik <[email protected]> | ||
|
||
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/18.0/website_sale_hide_empty_category>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Copyright 2017 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2017 LasLabs Inc. <https://laslabs.com/> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
{ | ||
"name": "Website Sale - Hide Empty Categories", | ||
"summary": "Hide any Product Categories that are empty", | ||
"version": "18.0.1.0.0", | ||
"category": "Website", | ||
"website": "https://github.com/OCA/e-commerce", | ||
"author": "LasLabs, Odoo Community Association (OCA)", | ||
"license": "LGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": ["website_sale"], | ||
"data": ["views/website_sale_templates.xml"], | ||
"assets": { | ||
"web.assets_tests": [ | ||
"/website_sale_hide_empty_category/static/src/js/tour.esm.js" | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_sale_hide_empty_category | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2021-02-25 17:46+0000\n" | ||
"Last-Translator: claudiagn <[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_hide_empty_category | ||
#: model:ir.model.fields,field_description:website_sale_hide_empty_category.field_product_public_category__has_product_recursive | ||
msgid "This category or one of its children has products" | ||
msgstr "Aquesta categoria o un dels seus fills té productes" | ||
|
||
#. module: website_sale_hide_empty_category | ||
#: model:ir.model,name:website_sale_hide_empty_category.model_product_public_category | ||
msgid "Website Product Category" | ||
msgstr "Categoria de producte del lloc web" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_sale_hide_empty_category | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: \n" | ||
"PO-Revision-Date: 2021-02-25 17:45+0000\n" | ||
"Last-Translator: claudiagn <[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.3.2\n" | ||
|
||
#. module: website_sale_hide_empty_category | ||
#: model:ir.model.fields,field_description:website_sale_hide_empty_category.field_product_public_category__has_product_recursive | ||
msgid "This category or one of its children has products" | ||
msgstr "Aquesta categoria o un dels seus fills té productes" | ||
|
||
#. module: website_sale_hide_empty_category | ||
#: model:ir.model,name:website_sale_hide_empty_category.model_product_public_category | ||
msgid "Website Product Category" | ||
msgstr "Categoría del Producto" | ||
|
||
#~ msgid "Products" | ||
#~ msgstr "Productos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_sale_hide_empty_category | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2020-12-15 13:19+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_hide_empty_category | ||
#: model:ir.model.fields,field_description:website_sale_hide_empty_category.field_product_public_category__has_product_recursive | ||
msgid "This category or one of its children has products" | ||
msgstr "Deze categorie of een van de subcategorieen bevat geen producten" | ||
|
||
#. module: website_sale_hide_empty_category | ||
#: model:ir.model,name:website_sale_hide_empty_category.model_product_public_category | ||
msgid "Website Product Category" | ||
msgstr "Website Product Categorie" |
24 changes: 24 additions & 0 deletions
24
website_sale_hide_empty_category/i18n/website_sale_hide_empty_category.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_sale_hide_empty_category | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.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" | ||
|
||
#. module: website_sale_hide_empty_category | ||
#: model:ir.model.fields,field_description:website_sale_hide_empty_category.field_product_public_category__has_product_recursive | ||
msgid "This category or one of its children has products" | ||
msgstr "" | ||
|
||
#. module: website_sale_hide_empty_category | ||
#: model:ir.model,name:website_sale_hide_empty_category.model_product_public_category | ||
msgid "Website Product Category" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2017 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from . import product_public_category |
22 changes: 22 additions & 0 deletions
22
website_sale_hide_empty_category/models/product_public_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2017 LasLabs Inc. | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ProductPublicCategory(models.Model): | ||
_inherit = "product.public.category" | ||
|
||
has_product_recursive = fields.Boolean( | ||
string="This category or one of its children has products", | ||
compute="_compute_has_product_recursive", | ||
recursive=True, | ||
) | ||
|
||
@api.depends("product_tmpl_ids", "child_id.has_product_recursive") | ||
def _compute_has_product_recursive(self): | ||
for category in self: | ||
category.has_product_recursive = bool( | ||
category.product_tmpl_ids | ||
or any(child.has_product_recursive for child in category.child_id) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
When the module is installed, by default the options to hide empty categories are active. | ||
|
||
These options can be configured in the web editor. To do this, go to ‘/shop’ and activate | ||
or deactivate the options to hide empty categories from the web editor in the ‘Customize’ tab. | ||
|
||
There are two options: | ||
|
||
- Hide Empty Category Filmstrip: to hide/show empty categories in the top category bar. | ||
- Hide Empty Category list: to hide/show empty categories in the left category list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- Ted Salmon \<<[email protected]>\> | ||
- [Tecnativa](https://www.tecnativa.com): | ||
- Carlos Roca | ||
- Pilar Vargas | ||
- Radovan Skolnik \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Removes any category links from the Shop which have no products | ||
associated to them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Once this module is installed and configured, go to ‘/shop’. Empty categories will not be show. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.