diff --git a/setup/website_sale_suggest_create_account/odoo/addons/website_sale_suggest_create_account b/setup/website_sale_suggest_create_account/odoo/addons/website_sale_suggest_create_account new file mode 120000 index 0000000000..ec53cb7d0a --- /dev/null +++ b/setup/website_sale_suggest_create_account/odoo/addons/website_sale_suggest_create_account @@ -0,0 +1 @@ +../../../../website_sale_suggest_create_account \ No newline at end of file diff --git a/setup/website_sale_suggest_create_account/setup.py b/setup/website_sale_suggest_create_account/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/website_sale_suggest_create_account/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/website_sale_suggest_create_account/README.rst b/website_sale_suggest_create_account/README.rst new file mode 100644 index 0000000000..43e1a04227 --- /dev/null +++ b/website_sale_suggest_create_account/README.rst @@ -0,0 +1,102 @@ +========================================== +Suggest to create user account when buying +========================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github + :target: https://github.com/OCA/e-commerce/tree/15.0/website_sale_suggest_create_account + :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-15-0/e-commerce-15-0-website_sale_suggest_create_account + :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/15.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of e-Commerce to suggest +the buyer to log in or create an account, but without forcing him to do it. + +This way you can avoid duplication of partners in your database and offer your +users a better experience without blocking 1-time buyers. + +However, the *Process Checkout* button is not highlighted, to +implicitly encourage users to create the account or log in. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +* Log out. +* Buy something from your website. +* Go to your cart. + +There you will see the new options. + +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 +* `Tecnativa `_: + + * Alexandre Díaz + * Carlos Roca +* Dhara Solanki (http://www.initos.com) +* Reinier Quevedo (http://www.mykubux.com) + +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_suggest_create_account/__init__.py b/website_sale_suggest_create_account/__init__.py new file mode 100644 index 0000000000..e315f7b241 --- /dev/null +++ b/website_sale_suggest_create_account/__init__.py @@ -0,0 +1 @@ +from .hooks import post_init_hook diff --git a/website_sale_suggest_create_account/__manifest__.py b/website_sale_suggest_create_account/__manifest__.py new file mode 100644 index 0000000000..6758045291 --- /dev/null +++ b/website_sale_suggest_create_account/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright (C) 2015 Antiun Ingeniería, S.L. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Suggest to create user account when buying", + "summary": "Suggest users to create an account when buying in the website", + "version": "16.0.1.0.0", + "category": "Website", + "website": "https://github.com/OCA/e-commerce", + "author": "Tecnativa, LasLabs, Odoo Community Association (OCA)", + "license": "LGPL-3", + "installable": True, + "depends": ["website_sale"], + "data": ["views/website_sale.xml"], + "assets": { + "web.assets_tests": [ + "website_sale_suggest_create_account/static/tests/tours/checkout.js", + ], + }, + "post_init_hook": "post_init_hook", +} diff --git a/website_sale_suggest_create_account/hooks.py b/website_sale_suggest_create_account/hooks.py new file mode 100644 index 0000000000..934d616cac --- /dev/null +++ b/website_sale_suggest_create_account/hooks.py @@ -0,0 +1,19 @@ +# 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): + # This is here to not broke the tests. The idea: + # - XML changes in website are made using 'customize_show=True' + # - When Odoo is running in testing mode, we disable our changes + # - When run our test, we enable the changes and test it. (see test file) + # + # For the user it has no impact (only more customizable options in the website) + # For CI/CD avoids problems testing modules that removes/positioning elements + # that other modules uses in their tests. + if config["test_enable"] or config["test_file"]: + env = api.Environment(cr, SUPERUSER_ID, {}) + env.ref("website_sale_suggest_create_account.cart").active = False + env.ref("website_sale_suggest_create_account.short_cart_summary").active = False diff --git a/website_sale_suggest_create_account/i18n/ca.po b/website_sale_suggest_create_account/i18n/ca.po new file mode 100644 index 0000000000..13651b35e2 --- /dev/null +++ b/website_sale_suggest_create_account/i18n/ca.po @@ -0,0 +1,43 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-01-06 21:13+0000\n" +"Last-Translator: Carles Antoli \n" +"Language-Team: none\n" +"Language: ca\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" +"X-Generator: Weblate 3.10\n" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "Iniciar la sessió i comprar" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "Log in and checkout\n" +" " +msgstr "" +"Accedir al seu compte i comprar\n" +" " + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "Registrar-se i comprar" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "Sign up and checkout\n" +" " +msgstr "" +"Registrar-se i comprar\n" +" " diff --git a/website_sale_suggest_create_account/i18n/ca_ES.po b/website_sale_suggest_create_account/i18n/ca_ES.po new file mode 100644 index 0000000000..deb895a096 --- /dev/null +++ b/website_sale_suggest_create_account/i18n/ca_ES.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ca_ES\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" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "Log in and checkout\n" +" " +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "Sign up and checkout\n" +" " +msgstr "" diff --git a/website_sale_suggest_create_account/i18n/de.po b/website_sale_suggest_create_account/i18n/de.po new file mode 100644 index 0000000000..a7324afed4 --- /dev/null +++ b/website_sale_suggest_create_account/i18n/de.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2018-08-27 19:24+0000\n" +"Last-Translator: Axel-G \n" +"Language-Team: none\n" +"Language: de\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" +"X-Generator: Weblate 3.1.1\n" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" +"Mit Login zur Kasse\n" +" " + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" +"Mit Registrierung zur Kasse\n" +" " + +#~ msgid "Checkout without sign up" +#~ msgstr "Zur Kasse ohne Registrierung" diff --git a/website_sale_suggest_create_account/i18n/es.po b/website_sale_suggest_create_account/i18n/es.po new file mode 100644 index 0000000000..297d6b8769 --- /dev/null +++ b/website_sale_suggest_create_account/i18n/es.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +# Translators: +# Pedro M. Baeza , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-29 01:20+0000\n" +"PO-Revision-Date: 2020-01-06 21:13+0000\n" +"Last-Translator: Carles Antoli \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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" +"X-Generator: Weblate 3.10\n" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "Iniciar sesión y comprar" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" +"Acceder a su cuenta y comprar\n" +"" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "Registrarse y comprar" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" +"Registrarse y comprar\n" +"" + +#~ msgid "Checkout without sign up" +#~ msgstr "Comprar sin registrarse" diff --git a/website_sale_suggest_create_account/i18n/es_CO.po b/website_sale_suggest_create_account/i18n/es_CO.po new file mode 100644 index 0000000000..a5f6a004ce --- /dev/null +++ b/website_sale_suggest_create_account/i18n/es_CO.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +# Translators: +# JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-02 03:46+0000\n" +"PO-Revision-Date: 2018-02-02 03:46+0000\n" +"Last-Translator: JOSE ALEJANDRO ECHEVERRI VALENCIA , 2018\n" +"Language-Team: Spanish (Colombia) (https://www.transifex.com/oca/teams/23907/" +"es_CO/)\n" +"Language: es_CO\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" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "Ingresar y pagar" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "Resgistrarse y pagar" + +#~ msgid "Checkout without sign up" +#~ msgstr "Pago sin registro" diff --git a/website_sale_suggest_create_account/i18n/fr.po b/website_sale_suggest_create_account/i18n/fr.po new file mode 100644 index 0000000000..e1f7fadf8c --- /dev/null +++ b/website_sale_suggest_create_account/i18n/fr.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +# Translators: +# Quentin THEURET , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-02 03:46+0000\n" +"PO-Revision-Date: 2018-02-02 03:46+0000\n" +"Last-Translator: Quentin THEURET , 2018\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" +"Se connecter et payer\n" +" " + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" +"S'enregistrer et payer\n" +" " + +#~ msgid "Checkout without sign up" +#~ msgstr "Paiement sans enregistrement " diff --git a/website_sale_suggest_create_account/i18n/hr.po b/website_sale_suggest_create_account/i18n/hr.po new file mode 100644 index 0000000000..705790ccbe --- /dev/null +++ b/website_sale_suggest_create_account/i18n/hr.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-11 07:32+0000\n" +"PO-Revision-Date: 2017-07-11 07:32+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" +"Prijavi se i završi \n" +" " + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" +"Kreiraj korisnika i završi \n" +" " + +#~ msgid "Checkout without sign up" +#~ msgstr "Završi bez prijave " diff --git a/website_sale_suggest_create_account/i18n/it.po b/website_sale_suggest_create_account/i18n/it.po new file mode 100644 index 0000000000..bfd01bd9a8 --- /dev/null +++ b/website_sale_suggest_create_account/i18n/it.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +# Translators: +# Paolo Valier, 2016 +# 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:34+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" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +#, fuzzy +msgid "Log in and checkout" +msgstr "Accedi e vai alla Cassa" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +#, fuzzy +msgid "Sign up and checkout" +msgstr "Registrati e vai alla Cassa" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" + +#, fuzzy +#~ msgid "Checkout without sign up" +#~ msgstr "Vai alla Cassa senza registrarti" + +#~ msgid "" +#~ "(\n" +#~ " user_id != website.user_id or\n" +#~ " env['ir.config_parameter'].get_param(\n" +#~ " 'auth_signup.allow_uninvited') != 'True' and\n" +#~ " not optional_products and website_sale_order and\n" +#~ " website_sale_order.website_order_line\n" +#~ " )" +#~ msgstr "" +#~ "(\n" +#~ "user_id != website.user_id or\n" +#~ "env['ir.config_parameter'].get_param(\n" +#~ "'auth_signup.allow_uninvited') != 'True' and\n" +#~ "not optional_products and website_sale_order and\n" +#~ "website_sale_order.website_order_line\n" +#~ ")" diff --git a/website_sale_suggest_create_account/i18n/nl.po b/website_sale_suggest_create_account/i18n/nl.po new file mode 100644 index 0000000000..f42dbd9f1e --- /dev/null +++ b/website_sale_suggest_create_account/i18n/nl.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-12-14 18:22+0000\n" +"Last-Translator: Yung-Wa \n" +"Language-Team: none\n" +"Language: nl\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "Aanmelden en afrekenen" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" +"Aanmelden en afrekening\n" +" " + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "Aanmelden en afrekenen" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" +"Aanmelden en afrekenen\n" +" " diff --git a/website_sale_suggest_create_account/i18n/sl.po b/website_sale_suggest_create_account/i18n/sl.po new file mode 100644 index 0000000000..002b67ce75 --- /dev/null +++ b/website_sale_suggest_create_account/i18n/sl.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +# Translators: +# Matjaž Mozetič , 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:56+0000\n" +"Last-Translator: Matjaž Mozetič \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" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +#, fuzzy +msgid "Log in and checkout" +msgstr "Prijava in blagajna" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +#, fuzzy +msgid "Sign up and checkout" +msgstr "Vpisnina in prijava" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" + +#, fuzzy +#~ msgid "Checkout without sign up" +#~ msgstr "Blagajna brez odjave" + +#~ msgid "" +#~ "(\n" +#~ " user_id != website.user_id or\n" +#~ " env['ir.config_parameter'].get_param(\n" +#~ " 'auth_signup.allow_uninvited') != 'True' and\n" +#~ " not optional_products and website_sale_order and\n" +#~ " website_sale_order.website_order_line\n" +#~ " )" +#~ msgstr "" +#~ "(\n" +#~ " user_id != website.user_id or\n" +#~ " env['ir.config_parameter'].get_param(\n" +#~ " 'auth_signup.allow_uninvited') != 'True' and\n" +#~ " not optional_products and website_sale_order and\n" +#~ " website_sale_order.website_order_line\n" +#~ " )" diff --git a/website_sale_suggest_create_account/i18n/website_sale_suggest_create_account.pot b/website_sale_suggest_create_account/i18n/website_sale_suggest_create_account.pot new file mode 100644 index 0000000000..7a028d190b --- /dev/null +++ b/website_sale_suggest_create_account/i18n/website_sale_suggest_create_account.pot @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_sale_suggest_create_account +# +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" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Log in and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Log in and checkout\n" +" " +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.short_cart_summary +msgid "Sign up and checkout" +msgstr "" + +#. module: website_sale_suggest_create_account +#: model_terms:ir.ui.view,arch_db:website_sale_suggest_create_account.cart +msgid "" +"Sign up and checkout\n" +" " +msgstr "" diff --git a/website_sale_suggest_create_account/readme/CONTRIBUTORS.rst b/website_sale_suggest_create_account/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..0c7fac5c45 --- /dev/null +++ b/website_sale_suggest_create_account/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* Rafael Blasco +* Jairo Llopis +* Dave Lasley +* Oscar Alcala +* Lorenzo Battistini +* `Tecnativa `_: + + * Alexandre Díaz + * Carlos Roca +* Dhara Solanki (http://www.initos.com) +* Reinier Quevedo (http://www.mykubux.com) diff --git a/website_sale_suggest_create_account/readme/DESCRIPTION.rst b/website_sale_suggest_create_account/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..978c79bbdd --- /dev/null +++ b/website_sale_suggest_create_account/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module extends the functionality of e-Commerce to suggest +the buyer to log in or create an account, but without forcing him to do it. + +This way you can avoid duplication of partners in your database and offer your +users a better experience without blocking 1-time buyers. + +However, the *Process Checkout* button is not highlighted, to +implicitly encourage users to create the account or log in. diff --git a/website_sale_suggest_create_account/readme/USAGE.rst b/website_sale_suggest_create_account/readme/USAGE.rst new file mode 100644 index 0000000000..1e10578c9e --- /dev/null +++ b/website_sale_suggest_create_account/readme/USAGE.rst @@ -0,0 +1,7 @@ +To use this module, you need to: + +* Log out. +* Buy something from your website. +* Go to your cart. + +There you will see the new options. diff --git a/website_sale_suggest_create_account/static/description/icon.png b/website_sale_suggest_create_account/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/website_sale_suggest_create_account/static/description/icon.png differ diff --git a/website_sale_suggest_create_account/static/description/index.html b/website_sale_suggest_create_account/static/description/index.html new file mode 100644 index 0000000000..e9180a9d77 --- /dev/null +++ b/website_sale_suggest_create_account/static/description/index.html @@ -0,0 +1,457 @@ + + + + + + +Suggest to create user account when buying + + + +
+

Suggest to create user account when buying

+ + +

Beta License: LGPL-3 OCA/e-commerce Translate me on Weblate Try me on Runbot

+

This module extends the functionality of e-Commerce to suggest +the buyer to log in or create an account, but without forcing him to do it.

+

This way you can avoid duplication of partners in your database and offer your +users a better experience without blocking 1-time buyers.

+

However, the Process Checkout button is not highlighted, to +implicitly encourage users to create the account or log in.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  • Log out.
  • +
  • Buy something from your website.
  • +
  • Go to your cart.
  • +
+

There you will see the new options.

+
+
+

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

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

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

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/website_sale_suggest_create_account/static/tests/tours/checkout.js b/website_sale_suggest_create_account/static/tests/tours/checkout.js new file mode 100644 index 0000000000..5a1ff171b2 --- /dev/null +++ b/website_sale_suggest_create_account/static/tests/tours/checkout.js @@ -0,0 +1,54 @@ +odoo.define("wbesite_sale_suggest_create_account.shop_buy", function (require) { + "use strict"; + + var tour = require("web_tour.tour"); + + tour.register( + "shop_buy_checkout_suggest_account_website", + { + test: true, + url: "/shop", + }, + [ + // Shop Page + { + trigger: "a.o_product_link:first", + }, + // Product Page + { + trigger: "#add_to_cart", + }, + // Go to cart + { + trigger: 'a[href="/shop/cart"]', + extra_trigger: "sup.my_cart_quantity:contains('1')", + }, + { + trigger: 'a.btn-secondary[href^="/web/login"]:first', + }, + // TODO: Add a step to check that "checkout" button doesn't exists + // Odoo 13.0 initial config doesn't have b2c actived for the website + // Login Page + { + trigger: "#login", + run: "text portal", + }, + { + trigger: "#password", + run: "text portal", + }, + { + trigger: "button.btn-primary:first", + }, + // Checkout Page + { + trigger: "button[name='o_payment_submit_button']", + }, + { + trigger: "span", + content: "Order", + }, + // The End + ] + ); +}); diff --git a/website_sale_suggest_create_account/tests/__init__.py b/website_sale_suggest_create_account/tests/__init__.py new file mode 100644 index 0000000000..77a72b1162 --- /dev/null +++ b/website_sale_suggest_create_account/tests/__init__.py @@ -0,0 +1 @@ +from . import test_shop_buy diff --git a/website_sale_suggest_create_account/tests/test_shop_buy.py b/website_sale_suggest_create_account/tests/test_shop_buy.py new file mode 100644 index 0000000000..088db508b4 --- /dev/null +++ b/website_sale_suggest_create_account/tests/test_shop_buy.py @@ -0,0 +1,20 @@ +# Copyright (C) 2020 Alexandre Díaz - Tecnativa S.L. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +import odoo.tests + + +@odoo.tests.tagged("post_install", "-at_install") +class TestUi(odoo.tests.HttpCase): + def test_01_shop_buy(self): + # Ensure that 'vat' is not empty for compatibility with + # website_sale_vat_required module + portal_user = self.env.ref("base.demo_user0") + if not portal_user.partner_id.vat: + portal_user.partner_id.vat = "BE1234567" + current_website = self.env["website"].get_current_website() + current_website.auth_signup_uninvited = "b2b" + self.env.ref("website_sale_suggest_create_account.cart").active = True + self.env.ref( + "website_sale_suggest_create_account.short_cart_summary" + ).active = True + self.start_tour("/shop", "shop_buy_checkout_suggest_account_website") diff --git a/website_sale_suggest_create_account/views/website_sale.xml b/website_sale_suggest_create_account/views/website_sale.xml new file mode 100644 index 0000000000..562a182e74 --- /dev/null +++ b/website_sale_suggest_create_account/views/website_sale.xml @@ -0,0 +1,124 @@ + + + + + + +