-
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] website_sale_checkout_skip_payment: Migration to 18.0
TT51372
- Loading branch information
1 parent
56ede45
commit 977a796
Showing
11 changed files
with
104 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ Contributors | |
- David Vidal | ||
- Alexandre Díaz | ||
- Carlos Roca | ||
- Pilar Vargas | ||
|
||
- Martin Wilderoth <[email protected]> | ||
- `Studio73 <https://www.studio73.es>`__: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
- David Vidal | ||
- Alexandre Díaz | ||
- Carlos Roca | ||
- Pilar Vargas | ||
- Martin Wilderoth \<<[email protected]>\> | ||
- [Studio73](https://www.studio73.es): | ||
- Miguel Gandia \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...e_checkout_skip_payment/static/tests/tours/website_sale_checkout_skip_payment_tour.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** @odoo-module **/ | ||
|
||
import {registry} from "@web/core/registry"; | ||
import * as tourUtils from "@website_sale/js/tours/tour_utils"; | ||
|
||
registry.category("web_tour.tours").add("website_sale_checkout_skip_payment", { | ||
url: "/shop", | ||
steps: () => [ | ||
...tourUtils.searchProduct("Storage Box"), | ||
{ | ||
content: "select Storage Box", | ||
trigger: '.oe_product_cart:first a:contains("Storage Box")', | ||
run: "click", | ||
}, | ||
{ | ||
content: "click on add to cart", | ||
trigger: '#product_detail form[action^="/shop/cart/update"] #add_to_cart', | ||
run: "click", | ||
}, | ||
tourUtils.goToCart({quantity: 1}), | ||
tourUtils.goToCheckout(), | ||
tourUtils.confirmOrder(), | ||
{ | ||
content: "Confirm order", | ||
trigger: "a.a-submit[href='#']:contains('Confirm')", | ||
run: "click", | ||
}, | ||
{ | ||
content: "Print order", | ||
trigger: "a[href='/shop/print']", | ||
}, | ||
], | ||
}); |
47 changes: 0 additions & 47 deletions
47
..._sale_checkout_skip_payment/static/tests/tours/website_sale_checkout_skip_payment_tour.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,60 +3,30 @@ | |
<!-- Copyright 2017 Sergio Teruel <[email protected]> | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> | ||
<template id="payment" inherit_id="website_sale.payment" priority="25"> | ||
<xpath expr="//div[hasclass('js_payment')]" position="after"> | ||
<div class="d-flex justify-content-between"> | ||
<div class="float-left mt-2" t-if="website.checkout_skip_payment"> | ||
<a role="button" href="/shop/cart" class="btn btn-secondary"> | ||
<i class="fa fa-chevron-left" /> | ||
Return to Cart | ||
</a> | ||
</div> | ||
<div | ||
class="js_skip_payment mt-3" | ||
t-if="website.checkout_skip_payment" | ||
id="skip_payment_method" | ||
> | ||
<form | ||
target="_self" | ||
action="/shop/confirmation" | ||
method="post" | ||
class="float-right" | ||
> | ||
<input | ||
type="hidden" | ||
name="csrf_token" | ||
t-att-value="request.csrf_token()" | ||
/> | ||
<a role="button" class="btn btn-primary a-submit" href="#"> | ||
<span>Confirm <span class="fa fa-chevron-right" /></span> | ||
</a> | ||
</form> | ||
</div> | ||
</div> | ||
</xpath> | ||
<xpath expr="//t[@name='website_sale_non_free_cart']" position="attributes"> | ||
<xpath expr="//div[@name='website_sale_non_free_cart']" position="attributes"> | ||
<attribute | ||
name="t-if" | ||
separator=" " | ||
add="and not website.checkout_skip_payment" | ||
separator="and" | ||
add="not website.checkout_skip_payment" | ||
/> | ||
</xpath> | ||
<xpath expr="//div[hasclass('js_payment')]" position="attributes"> | ||
</template> | ||
<template id="confirmation" inherit_id="website_sale.confirmation"> | ||
<xpath | ||
expr='//div[@t-if="tx_sudo.state in ['pending', 'done']"]' | ||
position="attributes" | ||
> | ||
<attribute | ||
name="t-if" | ||
separator=" " | ||
add="and not website.checkout_skip_payment" | ||
/> | ||
>tx_sudo.state in ['pending', 'done'] or (website.checkout_skip_payment and order.state == 'sale')</attribute> | ||
</xpath> | ||
</template> | ||
<template id="confirmation" inherit_id="website_sale.confirmation"> | ||
<xpath | ||
expr='//t[@t-if="payment_tx_id.state == 'done'"]' | ||
expr='//t[@t-if="tx_sudo.state == 'done'"]' | ||
position="attributes" | ||
> | ||
<attribute | ||
name="t-if" | ||
>payment_tx_id.state == 'done' or (website.checkout_skip_payment and order.state == 'sale')</attribute> | ||
>tx_sudo.state == 'done' or website.checkout_skip_payment</attribute> | ||
</xpath> | ||
<xpath | ||
expr="//t[@t-call='website_sale.payment_confirmation_status']" | ||
|
@@ -78,27 +48,45 @@ | |
<attribute name="t-if">not website.checkout_skip_payment</attribute> | ||
</xpath> | ||
</template> | ||
<template id="order_state_message"> | ||
<p>Your order is waiting manual confirmation.</p> | ||
<br /> | ||
</template> | ||
<template id="cart" inherit_id="website_sale.cart"> | ||
<xpath expr="//a[hasclass('btn-primary')]//t[2]/span[1]" position="attributes"> | ||
<template id="navigation_buttons" inherit_id="website_sale.navigation_buttons"> | ||
<xpath expr="//a[@name='website_sale_main_button']/t" position="attributes"> | ||
<attribute name="t-if">not website.checkout_skip_payment</attribute> | ||
</xpath> | ||
<xpath expr="//a[hasclass('btn-primary')]//t[2]/span[1]" position="after"> | ||
<xpath expr="//a[@name='website_sale_main_button']/t" position="after"> | ||
<span t-if="website.checkout_skip_payment">Confirm</span> | ||
</xpath> | ||
</template> | ||
<template id="short_cart_summary" inherit_id="website_sale.short_cart_summary"> | ||
<xpath | ||
expr="//a[hasclass('btn-secondary')]//t[2]/span[1]" | ||
position="attributes" | ||
> | ||
<attribute name="t-if">not website.checkout_skip_payment</attribute> | ||
</xpath> | ||
<xpath expr="//a[hasclass('btn-secondary')]//t[2]/span[1]" position="after"> | ||
<span t-if="website.checkout_skip_payment">Confirm</span> | ||
<xpath expr="//t[@t-else='']" position="after"> | ||
<div | ||
t-if="website.checkout_skip_payment and xmlid == 'website_sale.payment'" | ||
id="skip_payment_method" | ||
> | ||
<form | ||
name="o_wsale_confirm_order" | ||
class="d-flex flex-column" | ||
target="_self" | ||
action="/shop/confirmation" | ||
method="post" | ||
> | ||
<input | ||
type="hidden" | ||
name="csrf_token" | ||
t-att-value="request.csrf_token()" | ||
/> | ||
<a role="button" class="btn btn-primary a-submit" href="#"> | ||
<span>Confirm <span | ||
class="fa fa-angle-right ms-2 fw-light" | ||
/></span> | ||
</a> | ||
</form> | ||
</div> | ||
<div | ||
t-if="website.checkout_skip_payment and xmlid == 'website_sale.payment'" | ||
t-attf-class="position-relative #{_form_send_navigation and 'd-flex d-lg-none' or 'd-flex'} w-100 justify-content-center align-items-center my-2 opacity-75" | ||
> | ||
<hr class="w-100" /> | ||
<span class="px-3">or</span> | ||
<hr class="w-100" /> | ||
</div> | ||
</xpath> | ||
</template> | ||
</odoo> |