Skip to content

Commit

Permalink
[MIG] website_sale_require_legal: Migration to version 17.0
Browse files Browse the repository at this point in the history
TT51564
  • Loading branch information
pilarvargas-tecnativa committed Nov 18, 2024
1 parent 65372b1 commit fe6ce73
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion website_sale_require_legal/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Require accepting legal terms to checkout",
"summary": "Force the user to accept legal tems to buy in the web shop",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"category": "Website",
"website": "https://github.com/OCA/e-commerce",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
4 changes: 3 additions & 1 deletion website_sale_require_legal/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def shop_payment_transaction(self, order_id, access_token, **kwargs):
"""
result = super().shop_payment_transaction(order_id, access_token, **kwargs)
# If the "Accept Terms & Conditions" view is disabled, we log nothing
if not request.website.viewref("website_sale.payment_sale_note").active:
if not request.website.viewref(
"website_sale.accept_terms_and_conditions"
).active:
return result
# Retrieve the sale order
if order_id:
Expand Down
26 changes: 6 additions & 20 deletions website_sale_require_legal/static/tests/tours/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
* Copyright 2023 Pilar Vargas <[email protected]>
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */

odoo.define("website_sale_require_legal.tour", function (require) {
"use strict";

var tour = require("web_tour.tour");

var steps = [
import {registry} from "@web/core/registry";
registry.category("web_tour.tours").add("website_sale_require_legal", {
test: true,
url: "/shop",
steps: () => [
{
trigger: '.oe_product_cart a:contains("Customizable")',
},
Expand Down Expand Up @@ -67,18 +66,5 @@ odoo.define("website_sale_require_legal.tour", function (require) {
{
trigger: 'button[name="o_payment_submit_button"]',
},
];

tour.register(
"website_sale_require_legal",
{
url: "/shop",
test: true,
},
steps
);

return {
steps: steps,
};
],
});
2 changes: 1 addition & 1 deletion website_sale_require_legal/tests/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setUp(self):
website.viewref(
"website_sale_require_legal.address_require_legal"
).active = True
website.viewref("website_sale.payment_sale_note").active = True
website.viewref("website_sale.accept_terms_and_conditions").active = True
new_test_user(self.env, login="super_mario", groups="base.group_portal")
# Create a dummy payment provider to ensure that the tour has at least one
# available to it.
Expand Down

0 comments on commit fe6ce73

Please sign in to comment.