diff --git a/website_sale_require_login/README.rst b/website_sale_require_login/README.rst new file mode 100644 index 0000000..b0a6e63 --- /dev/null +++ b/website_sale_require_login/README.rst @@ -0,0 +1,101 @@ +========================= +Require login to checkout +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-AGPL--3-blue.png + :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/12.0/website_sale_require_login + :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-12-0/e-commerce-12-0-website_sale_require_login + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/113/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of eCommerce to force users +to login before buying anything in the website and allow you to get rid of +those duplicated entries of returning unauthenticated users. + +If you do not allow external users to sign up, this can serve you to make +checkout available only for those that have a user account, and make some sort +of *members club*. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +You probably want to enable any user to sign up: + +* Go to *Settings > General Settings > Website > Customer Account*. +* Enable *Free sign up*. + +Usage +===== + +To use this module, you need to: + +* Log out. +* Try to buy something. +* You will be forced to log in. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa +* LasLabs + +Contributors +~~~~~~~~~~~~ + +* Rafael Blasco +* Jairo Llopis +* Dave Lasley +* Oscar Alcala +* Lorenzo Battistini + +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 `_ 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_login/__init__.py b/website_sale_require_login/__init__.py new file mode 100644 index 0000000..2e4ebb3 --- /dev/null +++ b/website_sale_require_login/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2015 Antiun Ingeniería, S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import controllers diff --git a/website_sale_require_login/__manifest__.py b/website_sale_require_login/__manifest__.py new file mode 100644 index 0000000..682a644 --- /dev/null +++ b/website_sale_require_login/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2015 Antiun Ingeniería, S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Require login to checkout", + "summary": "Force users to login for buying", + "version": "12.0.1.0.0", + "category": "Website", + "website": "https://github.com/OCA/e-commerce", + "author": "Tecnativa, " + "LasLabs, " + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "depends": [ + "website_sale_suggest_create_account", + "web_tour", + ], + "data": [ + "views/website_sale.xml", + ], + 'demo': [ + "demo/demo_assets.xml", + ], +} diff --git a/website_sale_require_login/controllers/__init__.py b/website_sale_require_login/controllers/__init__.py new file mode 100644 index 0000000..dd3803d --- /dev/null +++ b/website_sale_require_login/controllers/__init__.py @@ -0,0 +1,4 @@ +# © 2015 Antiun Ingeniería, S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import main diff --git a/website_sale_require_login/controllers/main.py b/website_sale_require_login/controllers/main.py new file mode 100644 index 0000000..f02a352 --- /dev/null +++ b/website_sale_require_login/controllers/main.py @@ -0,0 +1,11 @@ +# Copyright 2015 Antiun Ingeniería, S.L. - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import http +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class RequireLoginToCheckout(WebsiteSale): + @http.route(auth="user") + def checkout(self, **post): + return super(RequireLoginToCheckout, self).checkout(**post) diff --git a/website_sale_require_login/demo/demo_assets.xml b/website_sale_require_login/demo/demo_assets.xml new file mode 100644 index 0000000..dc8ba7e --- /dev/null +++ b/website_sale_require_login/demo/demo_assets.xml @@ -0,0 +1,14 @@ + + + + + +