Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] website_sale_require_login: Migration to 16.0 #935

Open
wants to merge 27 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f5144d3
Add module website_sale_require_login.
yajo Nov 2, 2015
b59acb8
OCA Transbot updated translations from Transifex
oca-transbot Apr 2, 2016
188a7c9
version in website_sale_require_login
Dec 4, 2015
13980f3
website_sale_require_login: Upgrade to v9 * Migrate website_sale_requ…
lasley Sep 17, 2016
d59e04d
[MIG] website_sale_require_login: Migrated to 10.0
Nov 1, 2016
c370282
[FIX] website_sale_require_login: run unittests w/o workflow + PEP8
Sep 28, 2017
d6b5e31
[FIX] website_sale_require_login: name test numbering
Sep 29, 2017
a7e3be3
[REF] use variables to make it more readable and compatible
KolushovAlexandr Dec 8, 2017
d9b5207
[MIG] website_sale_require_login: basic migration v10 to v11
oscarolar Dec 21, 2017
64c17e2
Added translation using Weblate (German)
Aug 27, 2018
4bff24d
porting website_sale_require_login to 12.0
eLBati Oct 1, 2018
5ec138a
[FIX] website_sale_require_login: Fix public user test
yajo Apr 18, 2019
eed1b29
[IMP] website_sale_require_login: black, isort
Tardo Feb 2, 2020
4522dcc
[MIG] website_sale_require_login: Migration to 13.0
Tardo Feb 2, 2020
030cae0
[IMP] website_sale_require_login: Readme
Tardo Apr 21, 2020
86dca94
Added translation using Weblate (Spanish)
claudiagn Feb 25, 2021
82925d3
Added translation using Weblate (Catalan)
claudiagn Feb 25, 2021
561963a
[MIG] website_sale_require_login: Migration to 15.0
Feb 25, 2022
6b401aa
[FIX] website_sale_require_login: Fix tests
CarlosRoca13 May 24, 2022
a65eb8f
[UPD] Update website_sale_require_login.pot
Aug 3, 2022
8801eb4
[UPD] README.rst
OCA-git-bot Aug 3, 2022
f58e62e
Update translation files
oca-transbot Aug 3, 2022
6a87f7c
[IMP] website_sale_require_login: Avoid deprecation warning with `Env…
victoralmau Nov 29, 2022
58432ea
website_sale_require_login 15.0.1.0.1
OCA-git-bot Nov 29, 2022
3a069ef
[UPD] README.rst
OCA-git-bot Sep 3, 2023
733df99
[IMP] website_sale_require_login: pre-commit stuff
carolina-domatix Jun 11, 2024
18dcd95
[MIG] website_sale_require_login: Migration to 16.0
carolina-domatix Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions setup/website_sale_require_login/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
114 changes: 114 additions & 0 deletions website_sale_require_login/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
=========================
Require login to checkout
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d31099c8d3673974fe4f2080d192faee6bda63a0448355e89a57112bb895cce7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/16.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-16-0/e-commerce-16-0-website_sale_require_login
: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
:alt: Try me on Runboat

|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 <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_login%0Aversion:%2016.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
* LasLabs

Contributors
~~~~~~~~~~~~

* Dave Lasley <[email protected]>
* Oscar Alcala <[email protected]>
* Lorenzo Battistini <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

* Rafael Blasco
* Jairo Llopis
* Alexandre Diaz
* Carlos Roca

* Reinier Quevedo <[email protected]>

* `Domatix <https://domatix.com>`_:
* Carolina Ferrer

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/16.0/website_sale_require_login>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions website_sale_require_login/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 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
from .hooks import post_init_hook
20 changes: 20 additions & 0 deletions website_sale_require_login/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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": "16.0.1.0.1",
"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"],
"assets": {
"web.assets_tests": [
"website_sale_require_login/static/tests/tours/checkout.js",
],
},
"post_init_hook": "post_init_hook",
}
4 changes: 4 additions & 0 deletions website_sale_require_login/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions website_sale_require_login/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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().checkout(**post)
11 changes: 11 additions & 0 deletions website_sale_require_login/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (C) 2020 Alexandre Díaz - Tecnativa S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import SUPERUSER_ID, api
from odoo.tools import config


def post_init_hook(cr, registry):
if config["test_enable"] or config["test_file"]:
env = api.Environment(cr, SUPERUSER_ID, {})
env.ref("website_sale_require_login.cart").active = False
env.ref("website_sale_require_login.short_cart_summary").active = False
Empty file.
Empty file.
Empty file.
35 changes: 35 additions & 0 deletions website_sale_require_login/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_require_login
#
# Translators:
# Paolo Valier, 2016
msgid ""
msgstr ""
"Project-Id-Version: e-commerce (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-06 13:06+0000\n"
"PO-Revision-Date: 2016-05-01 08:33+0000\n"
"Last-Translator: Paolo Valier\n"
"Language-Team: Italian (http://www.transifex.com/oca/OCA-e-commerce-8-0/"
"language/it/)\n"
"Language: it\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"

#~ msgid ""
#~ "(\n"
#~ " user_id != website.user_id and\n"
#~ " not optional_products and\n"
#~ " website_sale_order and\n"
#~ " website_sale_order.website_order_line\n"
#~ " )"
#~ msgstr ""
#~ "(\n"
#~ "user_id != website.user_id and\n"
#~ "not optional_products and\n"
#~ "website_sale_order and\n"
#~ "website_sale_order.website_order_line\n"
#~ ")"
36 changes: 36 additions & 0 deletions website_sale_require_login/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_require_login
#
# Translators:
# Matjaž Mozetič <[email protected]>, 2016
msgid ""
msgstr ""
"Project-Id-Version: e-commerce (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-29 10:29+0000\n"
"PO-Revision-Date: 2016-04-01 04:55+0000\n"
"Last-Translator: Matjaž Mozetič <[email protected]>\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-e-commerce-8-0/"
"language/sl/)\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"

#~ msgid ""
#~ "(\n"
#~ " user_id != website.user_id and\n"
#~ " not optional_products and\n"
#~ " website_sale_order and\n"
#~ " website_sale_order.website_order_line\n"
#~ " )"
#~ msgstr ""
#~ "(\n"
#~ " user_id != website.user_id and\n"
#~ " not optional_products and\n"
#~ " website_sale_order and\n"
#~ " website_sale_order.website_order_line\n"
#~ " )"
13 changes: 13 additions & 0 deletions website_sale_require_login/i18n/website_sale_require_login.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
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"
4 changes: 4 additions & 0 deletions website_sale_require_login/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
You probably want to enable any user to sign up:

* Go to *Settings > General Settings > Website > Customer Account*.
* Enable *Free sign up*.
15 changes: 15 additions & 0 deletions website_sale_require_login/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* Dave Lasley <[email protected]>
* Oscar Alcala <[email protected]>
* Lorenzo Battistini <[email protected]>

* `Tecnativa <https://www.tecnativa.com>`_:

* Rafael Blasco
* Jairo Llopis
* Alexandre Diaz
* Carlos Roca

* Reinier Quevedo <[email protected]>

* `Domatix <https://domatix.com>`_:
* Carolina Ferrer
7 changes: 7 additions & 0 deletions website_sale_require_login/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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*.
5 changes: 5 additions & 0 deletions website_sale_require_login/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

* Log out.
* Try to buy something.
* You will be forced to log in.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading