From 070cdb705ab99c1dd42e7be31e38242b4ba6c21d Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Wed, 30 Aug 2023 16:35:22 +0200 Subject: [PATCH] [MIG] website_sale_suggest_create_account: Migration to version 16.0 TT44387 --- .../__manifest__.py | 2 +- .../static/tests/tours/checkout.js | 15 ++- .../tests/test_shop_buy.py | 12 +- .../views/website_sale.xml | 108 ++++++++---------- 4 files changed, 67 insertions(+), 70 deletions(-) diff --git a/website_sale_suggest_create_account/__manifest__.py b/website_sale_suggest_create_account/__manifest__.py index e5b8c3db33..07184dcaa4 100644 --- a/website_sale_suggest_create_account/__manifest__.py +++ b/website_sale_suggest_create_account/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Suggest to create user account when buying", "summary": "Suggest users to create an account when buying in the website", - "version": "15.0.1.0.1", + "version": "16.0.1.0.1", "category": "Website", "website": "https://github.com/OCA/e-commerce", "author": "Tecnativa, LasLabs, Odoo Community Association (OCA)", diff --git a/website_sale_suggest_create_account/static/tests/tours/checkout.js b/website_sale_suggest_create_account/static/tests/tours/checkout.js index 5a1ff171b2..4c3b22115a 100644 --- a/website_sale_suggest_create_account/static/tests/tours/checkout.js +++ b/website_sale_suggest_create_account/static/tests/tours/checkout.js @@ -12,19 +12,22 @@ odoo.define("wbesite_sale_suggest_create_account.shop_buy", function (require) { [ // Shop Page { - trigger: "a.o_product_link:first", + trigger: "a:contains('Customizable')", }, - // Product Page { trigger: "#add_to_cart", }, - // Go to cart { - trigger: 'a[href="/shop/cart"]', - extra_trigger: "sup.my_cart_quantity:contains('1')", + trigger: "button:contains('Proceed to Checkout')", }, + // Go to cart + // { + // trigger: 'a[href="/shop/cart"]', + // extra_trigger: "sup.my_cart_quantity:contains('1')", + // }, { - trigger: 'a.btn-secondary[href^="/web/login"]:first', + trigger: + "a.btn-primary[href='/web/login?redirect=/shop/checkout?express=1']", }, // 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 diff --git a/website_sale_suggest_create_account/tests/test_shop_buy.py b/website_sale_suggest_create_account/tests/test_shop_buy.py index 088db508b4..a9abd09c71 100644 --- a/website_sale_suggest_create_account/tests/test_shop_buy.py +++ b/website_sale_suggest_create_account/tests/test_shop_buy.py @@ -12,9 +12,19 @@ def test_01_shop_buy(self): 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" + current_website.account_on_checkout = "disabled" self.env.ref("website_sale_suggest_create_account.cart").active = True self.env.ref( "website_sale_suggest_create_account.short_cart_summary" ).active = True + if self.env["ir.module.module"]._get("payment_custom").state != "installed": + self.skipTest("Transfer provider is not installed") + transfer_provider = self.env.ref("payment.payment_provider_transfer") + transfer_provider.write( + { + "state": "enabled", + "is_published": True, + } + ) + transfer_provider._transfer_ensure_pending_msg_is_set() 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 index 28aa71162c..325dca5561 100644 --- a/website_sale_suggest_create_account/views/website_sale.xml +++ b/website_sale_suggest_create_account/views/website_sale.xml @@ -9,8 +9,7 @@ /> + + + - + #{'btn btn-primary float-right d-none d-xl-inline-block' if user_authenticated else 'btn btn-default float-right d-none d-xl-inline-block'} + >#{'btn btn-primary' if user_authenticated or redirect_to_sign_in else 'btn btn-light'} - - + - Log in and checkout - - - - Log in and checkout + + + - Sign up and checkout - - - - - - - - #{'btn btn-primary float-right' if user_authenticated else 'btn btn-default float-right'} - - - - Log in and checkout - - - - Sign up and checkout + + + + - Sign up and checkout - - - + Sign up + @@ -98,28 +70,40 @@ inherit_id="website_sale.short_cart_summary" customize_show="True" > - + #{'btn btn-secondary float-right d-none d-xl-inline-block' if user_authenticated else 'btn btn-default float-right d-none d-xl-inline-block'} + >#{'btn btn-secondary float-end d-none d-xl-inline-block' if user_authenticated or redirect_to_sign_in else 'btn btn-light float-end d-none d-xl-inline-block'} - + Log in and checkout + - + Sign up and checkout + + + + + Sign up +