From 65372b187fd0a6e1bd2c0a1db4db7da138c780aa Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Fri, 15 Nov 2024 15:09:09 +0100 Subject: [PATCH] [IMP] website_sale_require_legal: pre-commit auto fixes --- website_sale_require_legal/README.rst | 102 +++++++++--------- .../controllers/main.py | 2 +- website_sale_require_legal/pyproject.toml | 3 + .../readme/CONFIGURE.md | 23 ++++ .../readme/CONFIGURE.rst | 23 ---- website_sale_require_legal/readme/CONTEXT.md | 10 ++ website_sale_require_legal/readme/CONTEXT.rst | 9 -- .../readme/CONTRIBUTORS.md | 9 ++ .../readme/CONTRIBUTORS.rst | 9 -- .../readme/DESCRIPTION.md | 6 ++ .../readme/DESCRIPTION.rst | 6 -- website_sale_require_legal/readme/ROADMAP.md | 8 ++ website_sale_require_legal/readme/ROADMAP.rst | 8 -- website_sale_require_legal/readme/USAGE.md | 3 + website_sale_require_legal/readme/USAGE.rst | 3 - .../static/description/index.html | 75 +++++++------ 16 files changed, 153 insertions(+), 146 deletions(-) create mode 100644 website_sale_require_legal/pyproject.toml create mode 100644 website_sale_require_legal/readme/CONFIGURE.md delete mode 100644 website_sale_require_legal/readme/CONFIGURE.rst create mode 100644 website_sale_require_legal/readme/CONTEXT.md delete mode 100644 website_sale_require_legal/readme/CONTEXT.rst create mode 100644 website_sale_require_legal/readme/CONTRIBUTORS.md delete mode 100644 website_sale_require_legal/readme/CONTRIBUTORS.rst create mode 100644 website_sale_require_legal/readme/DESCRIPTION.md delete mode 100644 website_sale_require_legal/readme/DESCRIPTION.rst create mode 100644 website_sale_require_legal/readme/ROADMAP.md delete mode 100644 website_sale_require_legal/readme/ROADMAP.rst create mode 100644 website_sale_require_legal/readme/USAGE.md delete mode 100644 website_sale_require_legal/readme/USAGE.rst diff --git a/website_sale_require_legal/README.rst b/website_sale_require_legal/README.rst index c397bf5168..e9078db6b5 100644 --- a/website_sale_require_legal/README.rst +++ b/website_sale_require_legal/README.rst @@ -17,22 +17,22 @@ Require accepting legal terms to checkout :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_require_legal + :target: https://github.com/OCA/e-commerce/tree/17.0/website_sale_require_legal :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_require_legal + :target: https://translation.odoo-community.org/projects/e-commerce-17-0/e-commerce-17-0-website_sale_require_legal :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=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| This module extends your e-commerce legal compliance options: -#. Require accepting legal terms before submitting a new address. -#. Log a note in the partner when such terms are accepted. -#. Log a note in the sale order when terms are accepted before payment +1. Require accepting legal terms before submitting a new address. +2. Log a note in the partner when such terms are accepted. +3. Log a note in the sale order when terms are accepted before payment (done for every online payment, it is an upstream feature). **Table of contents** @@ -43,61 +43,65 @@ This module extends your e-commerce legal compliance options: Use Cases / Context =================== -This module adds the functionality to require the user to check the checkbox to accept -the legal terms in the address form. Additionally, it provides a metadata record for -both the user when legal terms are accepted through the address form and for the sales -order when legal terms are accepted during the payment process. +This module adds the functionality to require the user to check the +checkbox to accept the legal terms in the address form. Additionally, it +provides a metadata record for both the user when legal terms are +accepted through the address form and for the sales order when legal +terms are accepted during the payment process. -It's worth noting that this module can be useful even if the acceptance of legal terms -in the address form is not activated, as it stores a metadata record when the terms and -conditions are accepted during the payment process, even if a new address has not been -created. +It's worth noting that this module can be useful even if the acceptance +of legal terms in the address form is not activated, as it stores a +metadata record when the terms and conditions are accepted during the +payment process, even if a new address has not been created. Configuration ============= To configure this module, you need to: -#. Install it. +1. Install it. -#. Set up `your legal pages `__. +2. Set up `your legal pages `__. -#. Go to your e-commerce and make a sample checkout. +3. Go to your e-commerce and make a sample checkout. -#. Visit `/shop/address `__ and enable *Customize > Require - Legal Terms Acceptance*. +4. Visit `/shop/address `__ and enable *Customize > + Require Legal Terms Acceptance*. - .. figure:: https://raw.githubusercontent.com/OCA/e-commerce/16.0/website_sale_require_legal/static/description/address-enable.png + |image1| - This will require acceptance before recording a new address, and log visitor's - acceptance. + This will require acceptance before recording a new address, and log + visitor's acceptance. -#. Visit `/shop/payment `__ and enable *Customize > Accept Terms - & Conditions* (upstream Odoo feature). +5. Visit `/shop/payment `__ and enable *Customize > + Accept Terms & Conditions* (upstream Odoo feature). - .. figure:: https://raw.githubusercontent.com/OCA/e-commerce/16.0/website_sale_require_legal/static/description/payment-enable.png + |image2| - This will require acceptance before paying the sale order, and log visitor's - acceptance. + This will require acceptance before paying the sale order, and log + visitor's acceptance. + +.. |image1| image:: https://raw.githubusercontent.com/OCA/e-commerce/17.0/website_sale_require_legal/static/description/address-enable.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/e-commerce/17.0/website_sale_require_legal/static/description/payment-enable.png Usage ===== To use this module, you need to: -* Buy something from your website. +- Buy something from your website. Known issues / Roadmap ====================== -* Shopping terms and conditions are accepted only on user registration or - address edition. So if those terms change after the user signed up, a - notification should be made. An implicit acceptance could be printed in the - payment screen to solve this. Maybe that could be a work to develop in - another module. -* If you enable both acceptance views as explained in the configuration section, - first-time buyers will have to accept the legal terms between 2 and 3 times - to buy. +- Shopping terms and conditions are accepted only on user registration + or address edition. So if those terms change after the user signed + up, a notification should be made. An implicit acceptance could be + printed in the payment screen to solve this. Maybe that could be a + work to develop in another module. +- If you enable both acceptance views as explained in the configuration + section, first-time buyers will have to accept the legal terms + between 2 and 3 times to buy. Bug Tracker =========== @@ -105,7 +109,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. @@ -113,25 +117,25 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Rafael Blasco - * Jairo Llopis - * Vicent Cubells - * David Vidal - * Ernesto Tejeda - * Cristina Martin R. - * Pilar Vargas + - Rafael Blasco + - Jairo Llopis + - Vicent Cubells + - David Vidal + - Ernesto Tejeda + - Cristina Martin R. + - Pilar Vargas Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -143,6 +147,6 @@ 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 `_ 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_require_legal/controllers/main.py b/website_sale_require_legal/controllers/main.py index 4686eb939a..a5c5381047 100644 --- a/website_sale_require_legal/controllers/main.py +++ b/website_sale_require_legal/controllers/main.py @@ -50,7 +50,7 @@ def _log_acceptance_metadata(self, record): environ = request.httprequest.headers.environ message = _("Website legal terms acceptance metadata: %s") metadata = "
".join( - "{}: {}".format(val, environ.get(val)) + f"{val}: {environ.get(val)}" for val in ( "REMOTE_ADDR", "HTTP_USER_AGENT", diff --git a/website_sale_require_legal/pyproject.toml b/website_sale_require_legal/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/website_sale_require_legal/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_sale_require_legal/readme/CONFIGURE.md b/website_sale_require_legal/readme/CONFIGURE.md new file mode 100644 index 0000000000..a365d14373 --- /dev/null +++ b/website_sale_require_legal/readme/CONFIGURE.md @@ -0,0 +1,23 @@ +To configure this module, you need to: + +1. Install it. + +2. Set up [your legal pages](/legal). + +3. Go to your e-commerce and make a sample checkout. + +4. Visit [/shop/address](/shop/address) and enable *Customize \> + Require Legal Terms Acceptance*. + + ![](../static/description/address-enable.png) + + This will require acceptance before recording a new address, and log + visitor's acceptance. + +5. Visit [/shop/payment](/shop/payment) and enable *Customize \> Accept + Terms & Conditions* (upstream Odoo feature). + + ![](../static/description/payment-enable.png) + + This will require acceptance before paying the sale order, and log + visitor's acceptance. diff --git a/website_sale_require_legal/readme/CONFIGURE.rst b/website_sale_require_legal/readme/CONFIGURE.rst deleted file mode 100644 index 2937b0d0c9..0000000000 --- a/website_sale_require_legal/readme/CONFIGURE.rst +++ /dev/null @@ -1,23 +0,0 @@ -To configure this module, you need to: - -#. Install it. - -#. Set up `your legal pages `__. - -#. Go to your e-commerce and make a sample checkout. - -#. Visit `/shop/address `__ and enable *Customize > Require - Legal Terms Acceptance*. - - .. figure:: ../static/description/address-enable.png - - This will require acceptance before recording a new address, and log visitor's - acceptance. - -#. Visit `/shop/payment `__ and enable *Customize > Accept Terms - & Conditions* (upstream Odoo feature). - - .. figure:: ../static/description/payment-enable.png - - This will require acceptance before paying the sale order, and log visitor's - acceptance. diff --git a/website_sale_require_legal/readme/CONTEXT.md b/website_sale_require_legal/readme/CONTEXT.md new file mode 100644 index 0000000000..22e9664f40 --- /dev/null +++ b/website_sale_require_legal/readme/CONTEXT.md @@ -0,0 +1,10 @@ +This module adds the functionality to require the user to check the +checkbox to accept the legal terms in the address form. Additionally, it +provides a metadata record for both the user when legal terms are +accepted through the address form and for the sales order when legal +terms are accepted during the payment process. + +It's worth noting that this module can be useful even if the acceptance +of legal terms in the address form is not activated, as it stores a +metadata record when the terms and conditions are accepted during the +payment process, even if a new address has not been created. diff --git a/website_sale_require_legal/readme/CONTEXT.rst b/website_sale_require_legal/readme/CONTEXT.rst deleted file mode 100644 index 9b51021ead..0000000000 --- a/website_sale_require_legal/readme/CONTEXT.rst +++ /dev/null @@ -1,9 +0,0 @@ -This module adds the functionality to require the user to check the checkbox to accept -the legal terms in the address form. Additionally, it provides a metadata record for -both the user when legal terms are accepted through the address form and for the sales -order when legal terms are accepted during the payment process. - -It's worth noting that this module can be useful even if the acceptance of legal terms -in the address form is not activated, as it stores a metadata record when the terms and -conditions are accepted during the payment process, even if a new address has not been -created. diff --git a/website_sale_require_legal/readme/CONTRIBUTORS.md b/website_sale_require_legal/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..9bbc1a6670 --- /dev/null +++ b/website_sale_require_legal/readme/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +- [Tecnativa](https://www.tecnativa.com): + + > - Rafael Blasco + > - Jairo Llopis + > - Vicent Cubells + > - David Vidal + > - Ernesto Tejeda + > - Cristina Martin R. + > - Pilar Vargas diff --git a/website_sale_require_legal/readme/CONTRIBUTORS.rst b/website_sale_require_legal/readme/CONTRIBUTORS.rst deleted file mode 100644 index a2e7c9f2c0..0000000000 --- a/website_sale_require_legal/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,9 +0,0 @@ -* `Tecnativa `_: - - * Rafael Blasco - * Jairo Llopis - * Vicent Cubells - * David Vidal - * Ernesto Tejeda - * Cristina Martin R. - * Pilar Vargas diff --git a/website_sale_require_legal/readme/DESCRIPTION.md b/website_sale_require_legal/readme/DESCRIPTION.md new file mode 100644 index 0000000000..80f4d6b7f6 --- /dev/null +++ b/website_sale_require_legal/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This module extends your e-commerce legal compliance options: + +1. Require accepting legal terms before submitting a new address. +2. Log a note in the partner when such terms are accepted. +3. Log a note in the sale order when terms are accepted before payment + (done for every online payment, it is an upstream feature). diff --git a/website_sale_require_legal/readme/DESCRIPTION.rst b/website_sale_require_legal/readme/DESCRIPTION.rst deleted file mode 100644 index 54e9c0e84b..0000000000 --- a/website_sale_require_legal/readme/DESCRIPTION.rst +++ /dev/null @@ -1,6 +0,0 @@ -This module extends your e-commerce legal compliance options: - -#. Require accepting legal terms before submitting a new address. -#. Log a note in the partner when such terms are accepted. -#. Log a note in the sale order when terms are accepted before payment - (done for every online payment, it is an upstream feature). diff --git a/website_sale_require_legal/readme/ROADMAP.md b/website_sale_require_legal/readme/ROADMAP.md new file mode 100644 index 0000000000..5a3f04452b --- /dev/null +++ b/website_sale_require_legal/readme/ROADMAP.md @@ -0,0 +1,8 @@ +- Shopping terms and conditions are accepted only on user registration + or address edition. So if those terms change after the user signed up, + a notification should be made. An implicit acceptance could be printed + in the payment screen to solve this. Maybe that could be a work to + develop in another module. +- If you enable both acceptance views as explained in the configuration + section, first-time buyers will have to accept the legal terms between + 2 and 3 times to buy. diff --git a/website_sale_require_legal/readme/ROADMAP.rst b/website_sale_require_legal/readme/ROADMAP.rst deleted file mode 100644 index f05fbd1745..0000000000 --- a/website_sale_require_legal/readme/ROADMAP.rst +++ /dev/null @@ -1,8 +0,0 @@ -* Shopping terms and conditions are accepted only on user registration or - address edition. So if those terms change after the user signed up, a - notification should be made. An implicit acceptance could be printed in the - payment screen to solve this. Maybe that could be a work to develop in - another module. -* If you enable both acceptance views as explained in the configuration section, - first-time buyers will have to accept the legal terms between 2 and 3 times - to buy. diff --git a/website_sale_require_legal/readme/USAGE.md b/website_sale_require_legal/readme/USAGE.md new file mode 100644 index 0000000000..4e687f4f14 --- /dev/null +++ b/website_sale_require_legal/readme/USAGE.md @@ -0,0 +1,3 @@ +To use this module, you need to: + +- Buy something from your website. diff --git a/website_sale_require_legal/readme/USAGE.rst b/website_sale_require_legal/readme/USAGE.rst deleted file mode 100644 index 1376869c26..0000000000 --- a/website_sale_require_legal/readme/USAGE.rst +++ /dev/null @@ -1,3 +0,0 @@ -To use this module, you need to: - -* Buy something from your website. diff --git a/website_sale_require_legal/static/description/index.html b/website_sale_require_legal/static/description/index.html index 0b5a5ad8a8..e5ae13d0fe 100644 --- a/website_sale_require_legal/static/description/index.html +++ b/website_sale_require_legal/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,7 +369,7 @@

Require accepting legal terms to checkout

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:fb7818797158569b096d297241bf594892e1cf2b346237ca602f4f900edd90b6 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module extends your e-commerce legal compliance options:

  1. Require accepting legal terms before submitting a new address.
  2. @@ -395,14 +395,15 @@

    Require accepting legal terms to checkout

    Use Cases / Context

    -

    This module adds the functionality to require the user to check the checkbox to accept -the legal terms in the address form. Additionally, it provides a metadata record for -both the user when legal terms are accepted through the address form and for the sales -order when legal terms are accepted during the payment process.

    -

    It’s worth noting that this module can be useful even if the acceptance of legal terms -in the address form is not activated, as it stores a metadata record when the terms and -conditions are accepted during the payment process, even if a new address has not been -created.

    +

    This module adds the functionality to require the user to check the +checkbox to accept the legal terms in the address form. Additionally, it +provides a metadata record for both the user when legal terms are +accepted through the address form and for the sales order when legal +terms are accepted during the payment process.

    +

    It’s worth noting that this module can be useful even if the acceptance +of legal terms in the address form is not activated, as it stores a +metadata record when the terms and conditions are accepted during the +payment process, even if a new address has not been created.

    Configuration

    @@ -414,21 +415,17 @@

    Configuration

  3. Go to your e-commerce and make a sample checkout.

  4. -
  5. Visit /shop/address and enable Customize > Require -Legal Terms Acceptance.

    -
    -https://raw.githubusercontent.com/OCA/e-commerce/16.0/website_sale_require_legal/static/description/address-enable.png -
    -

    This will require acceptance before recording a new address, and log visitor’s -acceptance.

    +
  6. Visit /shop/address and enable Customize > +Require Legal Terms Acceptance.

    +

    image1

    +

    This will require acceptance before recording a new address, and log +visitor’s acceptance.

  7. -
  8. Visit /shop/payment and enable Customize > Accept Terms -& Conditions (upstream Odoo feature).

    -
    -https://raw.githubusercontent.com/OCA/e-commerce/16.0/website_sale_require_legal/static/description/payment-enable.png -
    -

    This will require acceptance before paying the sale order, and log visitor’s -acceptance.

    +
  9. Visit /shop/payment and enable Customize > +Accept Terms & Conditions (upstream Odoo feature).

    +

    image2

    +

    This will require acceptance before paying the sale order, and log +visitor’s acceptance.

@@ -442,14 +439,14 @@

Usage

Known issues / Roadmap

    -
  • Shopping terms and conditions are accepted only on user registration or -address edition. So if those terms change after the user signed up, a -notification should be made. An implicit acceptance could be printed in the -payment screen to solve this. Maybe that could be a work to develop in -another module.
  • -
  • If you enable both acceptance views as explained in the configuration section, -first-time buyers will have to accept the legal terms between 2 and 3 times -to buy.
  • +
  • Shopping terms and conditions are accepted only on user registration +or address edition. So if those terms change after the user signed +up, a notification should be made. An implicit acceptance could be +printed in the payment screen to solve this. Maybe that could be a +work to develop in another module.
  • +
  • If you enable both acceptance views as explained in the configuration +section, first-time buyers will have to accept the legal terms +between 2 and 3 times to buy.
@@ -457,7 +454,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.

@@ -489,11 +486,13 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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 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.