Skip to content

Commit

Permalink
[MIG] website_sale_suggest_create_account: Upgrade to v9
Browse files Browse the repository at this point in the history
* Migrate website_sale_suggest_create_account to v9
* Update author to Tecnativa
* Update ReadMe issues text to new template
  • Loading branch information
lasley committed Sep 19, 2016
1 parent 3407ed6 commit 4e38759
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 58 deletions.
15 changes: 6 additions & 9 deletions website_sale_suggest_create_account/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,15 @@ There you will see the new options.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/113/8.0
:target: https://runbot.odoo-community.org/runbot/113/9.0

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 smashing it by
providing a detailed and welcomed feedback `here <https://github.com/OCA/
e-commerce/issues/new?body=module:%20
website_sale_suggest_create_user%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior
**%0A%0A**Expected%20behavior**>`_.
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 smashing it by providing a detailed and welcomed feedback.

Credits
=======
Expand All @@ -60,6 +56,7 @@ Contributors

* Rafael Blasco <rafabn@antiun.com>
* Jairo Llopis <yajo.sk8@gmail.com>
* Dave Lasley <dave@laslabs.com>

Maintainer
----------
Expand Down
13 changes: 4 additions & 9 deletions website_sale_suggest_create_account/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@
{
"name": "Suggest to create user account when buying",
"summary": "Suggest users to create an account when buying in the website",
"version": "8.0.1.0.0",
"version": "9.0.1.0.0",
"category": "Website",
"website": "http://www.antiun.com",
"author": "Antiun Ingeniería S.L., Odoo Community Association (OCA)",
"author": "Tecnativa, "
"LasLabs, "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {
"python": [],
"bin": [],
},
"depends": [
"website_sale",
],
"data": [
"views/website_sale.xml",
],
"demo": [
],
}
78 changes: 38 additions & 40 deletions website_sale_suggest_create_account/views/website_sale.xml
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>

<template id="cart" inherit_id="website_sale.cart">
<!-- Show normal "Checkout" button if user is logged in or external login
is disabled -->
<xpath expr="//a[@href='/shop/checkout']" position="attributes">
<attribute name="t-if">(
user_id != website.user_id or
env['ir.config_parameter'].get_param(
'auth_signup.allow_uninvited') != 'True' and
not optional_products and website_sale_order and
website_sale_order.website_order_line
)</attribute>
</xpath>

<!-- Show choice in other cases -->
<xpath expr="//a[@href='/shop/checkout']" position="after">
<a t-if="user_id == website.user_id"
class="btn btn-primary pull-right mb32"
href="/web/login?redirect=/shop/checkout">
<span>Log in and checkout</span>
<span class="fa fa-long-arrow-right"/>
</a>
<t t-if="(user_id == website.user_id and
env['ir.config_parameter'].get_param(
'auth_signup.allow_uninvited') == 'True' and
not optional_products and website_sale_order and
website_sale_order.website_order_line)">
<a class="btn btn-primary pull-right mb32"
href="/web/signup?redirect=/shop/checkout">
<span>Sign up and checkout</span>
<odoo>

<template id="cart" inherit_id="website_sale.cart">
<!-- Show normal "Checkout" button if user is logged in or external login
is disabled -->
<xpath expr="//a[@href='/shop/checkout']" position="attributes">
<attribute name="t-if">(
user_id != website.user_id or
env['ir.config_parameter'].get_param(
'auth_signup.allow_uninvited') != 'True' and
not optional_products and website_sale_order and
website_sale_order.website_order_line
)</attribute>
</xpath>

<!-- Show choice in other cases -->
<xpath expr="//a[@href='/shop/checkout']" position="after">
<a t-if="user_id == website.user_id"
class="btn btn-primary pull-right mb32"
href="/web/login?redirect=/shop/checkout">
<span>Log in and checkout</span>
<span class="fa fa-long-arrow-right"/>
</a>
<a id="anonymous_checkout" class="btn btn-default mb32" href="/shop/checkout">
<span>Checkout without sign up</span>
</a>
</t>
</xpath>
</template>
<t t-if="(user_id == website.user_id and
env['ir.config_parameter'].get_param(
'auth_signup.allow_uninvited') == 'True' and
not optional_products and website_sale_order and
website_sale_order.website_order_line)">
<a class="btn btn-primary pull-right mb32"
href="/web/signup?redirect=/shop/checkout">
<span>Sign up and checkout</span>
<span class="fa fa-long-arrow-right"/>
</a>
<a id="anonymous_checkout" class="btn btn-default mb32" href="/shop/checkout">
<span>Checkout without sign up</span>
</a>
</t>
</xpath>
</template>

</data>
</openerp>
</odoo>

0 comments on commit 4e38759

Please sign in to comment.