From 5f30180f9748d0819e5998be0eb8ebddc1a644d7 Mon Sep 17 00:00:00 2001 From: Pieter Paulussen Date: Wed, 18 Dec 2024 15:09:53 +0100 Subject: [PATCH] [IMP] website_sale_product_assortment: pre-commit auto fixes --- website_sale_product_assortment/README.rst | 65 ++++++++++--------- .../controllers/website_sale.py | 7 +- .../pyproject.toml | 3 + .../readme/CONFIGURE.md | 17 +++++ .../readme/CONFIGURE.rst | 14 ---- .../readme/CONTRIBUTORS.md | 9 +++ .../readme/CONTRIBUTORS.rst | 9 --- .../readme/DESCRIPTION.md | 2 + .../readme/DESCRIPTION.rst | 1 - .../static/description/index.html | 45 ++++++------- .../views/ir_filters_views.xml | 34 +++++----- 11 files changed, 109 insertions(+), 97 deletions(-) create mode 100644 website_sale_product_assortment/pyproject.toml create mode 100644 website_sale_product_assortment/readme/CONFIGURE.md delete mode 100644 website_sale_product_assortment/readme/CONFIGURE.rst create mode 100644 website_sale_product_assortment/readme/CONTRIBUTORS.md delete mode 100644 website_sale_product_assortment/readme/CONTRIBUTORS.rst create mode 100644 website_sale_product_assortment/readme/DESCRIPTION.md delete mode 100644 website_sale_product_assortment/readme/DESCRIPTION.rst diff --git a/website_sale_product_assortment/README.rst b/website_sale_product_assortment/README.rst index 8a725cc8c2..36256b1326 100644 --- a/website_sale_product_assortment/README.rst +++ b/website_sale_product_assortment/README.rst @@ -17,18 +17,19 @@ eCommerce product assortment :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/16.0/website_sale_product_assortment + :target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_product_assortment :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-16-0/e-commerce-16-0-website_sale_product_assortment + :target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_product_assortment :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=16.0 + :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| -This module allows to set e-commerce restrictions on product assortments. +This module allows to set e-commerce restrictions on product +assortments. **Table of contents** @@ -38,20 +39,23 @@ This module allows to set e-commerce restrictions on product assortments. Configuration ============= -To see this module working, you have to define a product assortment and select -an option on the website availability field. - -- **Don't apply restriction**: This option will not set any kind of restriction on - product items. -- **Avoid to show non available products**: This option will hide on the e-commerce, the - products that are not added to the products domain. If a product template has at least - one allowed variant to show, the product will appear on the product items view but only - that variants will be able to be bought. -- **Avoid selling not available products**: This option will restrict to buy the - products that are added to the assortment on the e-commerce. To inform the clients, - two more fields were added: "Message when unavailable" and "Assortment information". - The first one will add a short description to the product item and the other one will set a - detailed description on the product sheet. This second one is editable from the website editor. +To see this module working, you have to define a product assortment and +select an option on the website availability field. + +- **Don't apply restriction**: This option will not set any kind of + restriction on product items. +- **Avoid to show non available products**: This option will hide on the + e-commerce, the products that are not added to the products domain. If + a product template has at least one allowed variant to show, the + product will appear on the product items view but only that variants + will be able to be bought. +- **Avoid selling not available products**: This option will restrict to + buy the products that are added to the assortment on the e-commerce. + To inform the clients, two more fields were added: "Message when + unavailable" and "Assortment information". The first one will add a + short description to the product item and the other one will set a + detailed description on the product sheet. This second one is editable + from the website editor. Bug Tracker =========== @@ -59,7 +63,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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -67,25 +71,26 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Carlos Roca - * Pedro M. Baeza - * Stefan Ungureanu - * Pilar Vargas + - Carlos Roca + - Pedro M. Baeza + - Stefan Ungureanu + - Pilar Vargas -* `Ooops `_: - * Ashish Hirpara (https://ashish-hirpara.com) +- `Ooops `__: + + - Ashish Hirpara (https://ashish-hirpara.com) Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -105,6 +110,6 @@ Current `maintainer `__: |maintainer-CarlosRoca13| -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_product_assortment/controllers/website_sale.py b/website_sale_product_assortment/controllers/website_sale.py index 20252bafb8..f8b64a205c 100644 --- a/website_sale_product_assortment/controllers/website_sale.py +++ b/website_sale_product_assortment/controllers/website_sale.py @@ -30,8 +30,7 @@ def _get_products_allowed(self): if ( # Set active_test to False to allow filtering by partners # that are not active, (for example Public User) - partner - & assortment.with_context(active_test=False).all_partner_ids + partner & assortment.with_context(active_test=False).all_partner_ids ): assortment_restriction = True allowed_product_ids = allowed_product_ids.union( @@ -58,7 +57,7 @@ def _get_search_options( min_price=0.0, max_price=0.0, conversion_rate=1, - **post + **post, ): """Overriding _get_search_options method to avoid show product templates that has all their variants not allowed to be shown.""" @@ -69,7 +68,7 @@ def _get_search_options( min_price=min_price, max_price=max_price, conversion_rate=conversion_rate, - **post + **post, ) allowed_product_ids, assortment_restriction = self._get_products_allowed() if assortment_restriction: diff --git a/website_sale_product_assortment/pyproject.toml b/website_sale_product_assortment/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/website_sale_product_assortment/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_sale_product_assortment/readme/CONFIGURE.md b/website_sale_product_assortment/readme/CONFIGURE.md new file mode 100644 index 0000000000..50164809db --- /dev/null +++ b/website_sale_product_assortment/readme/CONFIGURE.md @@ -0,0 +1,17 @@ +To see this module working, you have to define a product assortment and +select an option on the website availability field. + +- **Don't apply restriction**: This option will not set any kind of + restriction on product items. +- **Avoid to show non available products**: This option will hide on the + e-commerce, the products that are not added to the products domain. If + a product template has at least one allowed variant to show, the + product will appear on the product items view but only that variants + will be able to be bought. +- **Avoid selling not available products**: This option will restrict to + buy the products that are added to the assortment on the e-commerce. + To inform the clients, two more fields were added: "Message when + unavailable" and "Assortment information". The first one will add a + short description to the product item and the other one will set a + detailed description on the product sheet. This second one is editable + from the website editor. diff --git a/website_sale_product_assortment/readme/CONFIGURE.rst b/website_sale_product_assortment/readme/CONFIGURE.rst deleted file mode 100644 index 3e4a40bb93..0000000000 --- a/website_sale_product_assortment/readme/CONFIGURE.rst +++ /dev/null @@ -1,14 +0,0 @@ -To see this module working, you have to define a product assortment and select -an option on the website availability field. - -- **Don't apply restriction**: This option will not set any kind of restriction on - product items. -- **Avoid to show non available products**: This option will hide on the e-commerce, the - products that are not added to the products domain. If a product template has at least - one allowed variant to show, the product will appear on the product items view but only - that variants will be able to be bought. -- **Avoid selling not available products**: This option will restrict to buy the - products that are added to the assortment on the e-commerce. To inform the clients, - two more fields were added: "Message when unavailable" and "Assortment information". - The first one will add a short description to the product item and the other one will set a - detailed description on the product sheet. This second one is editable from the website editor. diff --git a/website_sale_product_assortment/readme/CONTRIBUTORS.md b/website_sale_product_assortment/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..69b0690b5e --- /dev/null +++ b/website_sale_product_assortment/readme/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +- [Tecnativa](https://www.tecnativa.com): + + > - Carlos Roca + > - Pedro M. Baeza + > - Stefan Ungureanu + > - Pilar Vargas + +- [Ooops](https://www.ooops404.com): + - Ashish Hirpara () diff --git a/website_sale_product_assortment/readme/CONTRIBUTORS.rst b/website_sale_product_assortment/readme/CONTRIBUTORS.rst deleted file mode 100644 index 2de082face..0000000000 --- a/website_sale_product_assortment/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,9 +0,0 @@ -* `Tecnativa `_: - - * Carlos Roca - * Pedro M. Baeza - * Stefan Ungureanu - * Pilar Vargas - -* `Ooops `_: - * Ashish Hirpara (https://ashish-hirpara.com) diff --git a/website_sale_product_assortment/readme/DESCRIPTION.md b/website_sale_product_assortment/readme/DESCRIPTION.md new file mode 100644 index 0000000000..9c406c981f --- /dev/null +++ b/website_sale_product_assortment/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to set e-commerce restrictions on product +assortments. diff --git a/website_sale_product_assortment/readme/DESCRIPTION.rst b/website_sale_product_assortment/readme/DESCRIPTION.rst deleted file mode 100644 index ffd0a25f89..0000000000 --- a/website_sale_product_assortment/readme/DESCRIPTION.rst +++ /dev/null @@ -1 +0,0 @@ -This module allows to set e-commerce restrictions on product assortments. diff --git a/website_sale_product_assortment/static/description/index.html b/website_sale_product_assortment/static/description/index.html index fccdc6f203..2a0e1525c6 100644 --- a/website_sale_product_assortment/static/description/index.html +++ b/website_sale_product_assortment/static/description/index.html @@ -369,8 +369,9 @@

eCommerce product assortment

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:8e88100810c184dbe7c65e94e84d6618e51d1e01c9b1e39a6e387eed36668a05 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

This module allows to set e-commerce restrictions on product assortments.

+

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

+

This module allows to set e-commerce restrictions on product +assortments.

Table of contents

    @@ -386,20 +387,23 @@

    eCommerce product assortment

Configuration

-

To see this module working, you have to define a product assortment and select -an option on the website availability field.

+

To see this module working, you have to define a product assortment and +select an option on the website availability field.

    -
  • Don’t apply restriction: This option will not set any kind of restriction on -product items.
  • -
  • Avoid to show non available products: This option will hide on the e-commerce, the -products that are not added to the products domain. If a product template has at least -one allowed variant to show, the product will appear on the product items view but only -that variants will be able to be bought.
  • -
  • Avoid selling not available products: This option will restrict to buy the -products that are added to the assortment on the e-commerce. To inform the clients, -two more fields were added: “Message when unavailable” and “Assortment information”. -The first one will add a short description to the product item and the other one will set a -detailed description on the product sheet. This second one is editable from the website editor.
  • +
  • Don’t apply restriction: This option will not set any kind of +restriction on product items.
  • +
  • Avoid to show non available products: This option will hide on the +e-commerce, the products that are not added to the products domain. If +a product template has at least one allowed variant to show, the +product will appear on the product items view but only that variants +will be able to be bought.
  • +
  • Avoid selling not available products: This option will restrict to +buy the products that are added to the assortment on the e-commerce. +To inform the clients, two more fields were added: “Message when +unavailable” and “Assortment information”. The first one will add a +short description to the product item and the other one will set a +detailed description on the product sheet. This second one is editable +from the website editor.
@@ -407,7 +411,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 to smash it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -431,13 +435,10 @@

Contributors

-
  • -
    Ooops:
    -
    -
  • @@ -452,7 +453,7 @@

    Maintainers

    promote its widespread use.

    Current maintainer:

    CarlosRoca13

    -

    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_product_assortment/views/ir_filters_views.xml b/website_sale_product_assortment/views/ir_filters_views.xml index 51142aa750..10140fe35f 100644 --- a/website_sale_product_assortment/views/ir_filters_views.xml +++ b/website_sale_product_assortment/views/ir_filters_views.xml @@ -2,30 +2,30 @@ - - ir.filters - + ir.filters + - - - - - - - - - + + + + + + + + - - - - - + + + +