Skip to content

Commit

Permalink
[IMP] website_sale_require_legal: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pilarvargas-tecnativa committed Nov 15, 2024
1 parent ec4dda1 commit 65372b1
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 146 deletions.
102 changes: 53 additions & 49 deletions website_sale_require_legal/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand All @@ -43,95 +43,99 @@ 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 </legal>`__.
2. Set up `your legal pages </legal>`__.

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

#. Visit `/shop/address </shop/address>`__ and enable *Customize > Require
Legal Terms Acceptance*.
4. Visit `/shop/address </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 </shop/payment>`__ and enable *Customize > Accept Terms
& Conditions* (upstream Odoo feature).
5. Visit `/shop/payment </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
===========

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_require_legal%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_require_legal%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>`_:
- `Tecnativa <https://www.tecnativa.com>`__:

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

Expand All @@ -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 <https://github.com/OCA/e-commerce/tree/16.0/website_sale_require_legal>`_ project on GitHub.
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/17.0/website_sale_require_legal>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion website_sale_require_legal/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _log_acceptance_metadata(self, record):
environ = request.httprequest.headers.environ
message = _("Website legal terms acceptance metadata: %s")
metadata = "<br/>".join(
"{}: {}".format(val, environ.get(val))
f"{val}: {environ.get(val)}"
for val in (
"REMOTE_ADDR",
"HTTP_USER_AGENT",
Expand Down
3 changes: 3 additions & 0 deletions website_sale_require_legal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
23 changes: 23 additions & 0 deletions website_sale_require_legal/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -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.
23 changes: 0 additions & 23 deletions website_sale_require_legal/readme/CONFIGURE.rst

This file was deleted.

10 changes: 10 additions & 0 deletions website_sale_require_legal/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -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.
9 changes: 0 additions & 9 deletions website_sale_require_legal/readme/CONTEXT.rst

This file was deleted.

9 changes: 9 additions & 0 deletions website_sale_require_legal/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- [Tecnativa](https://www.tecnativa.com):

> - Rafael Blasco
> - Jairo Llopis
> - Vicent Cubells
> - David Vidal
> - Ernesto Tejeda
> - Cristina Martin R.
> - Pilar Vargas
9 changes: 0 additions & 9 deletions website_sale_require_legal/readme/CONTRIBUTORS.rst

This file was deleted.

6 changes: 6 additions & 0 deletions website_sale_require_legal/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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).
6 changes: 0 additions & 6 deletions website_sale_require_legal/readme/DESCRIPTION.rst

This file was deleted.

8 changes: 8 additions & 0 deletions website_sale_require_legal/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 0 additions & 8 deletions website_sale_require_legal/readme/ROADMAP.rst

This file was deleted.

3 changes: 3 additions & 0 deletions website_sale_require_legal/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
To use this module, you need to:

- Buy something from your website.
3 changes: 0 additions & 3 deletions website_sale_require_legal/readme/USAGE.rst

This file was deleted.

Loading

0 comments on commit 65372b1

Please sign in to comment.