-
-
Notifications
You must be signed in to change notification settings - Fork 500
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_require_login: Migration to 17.0
- Loading branch information
1 parent
44df5a9
commit b4f8bb9
Showing
7 changed files
with
52 additions
and
86 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
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
# 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): | ||
def post_init_hook(env): | ||
if config["test_enable"] or config["test_file"]: | ||
with api.Environment.manage(): | ||
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 | ||
cart_ref = env.ref("website_sale_require_login.cart", raise_if_not_found=False) | ||
if cart_ref: | ||
cart_ref.active = False | ||
|
||
short_cart_summary_ref = env.ref( | ||
"website_sale_require_login.short_cart_summary", raise_if_not_found=False | ||
) | ||
if short_cart_summary_ref: | ||
short_cart_summary_ref.active = False | ||
34 changes: 34 additions & 0 deletions
34
website_sale_require_login/static/tests/tours/checkout.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,34 @@ | ||
/** @odoo-module */ | ||
|
||
import {registry} from "@web/core/registry"; | ||
|
||
registry.category("web_tour.tours").add("shop_buy_checkout_required_login_website", { | ||
test: true, | ||
url: "/shop", | ||
steps: () => [ | ||
// Shop Page | ||
{ | ||
trigger: "td.oe_product a:first", | ||
}, | ||
// Product Page | ||
{ | ||
trigger: "#add_to_cart", | ||
}, | ||
{ | ||
trigger: 'a.o_navlink_background.btn[href="/shop/cart"]', | ||
}, | ||
{ | ||
trigger: '.oe_website_sale:not(a.btn-primary[href^="/shop/checkout"])', | ||
run: function () { | ||
// Check: do nothing | ||
}, | ||
}, | ||
{ | ||
trigger: '.oe_website_sale:not(a.btn-default[href^="/shop/checkout"])', | ||
run: function () { | ||
// Check: do nothing | ||
}, | ||
}, | ||
// The End | ||
], | ||
}); |
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 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