Skip to content
Snippets Groups Projects
Commit 5cdc3300 authored by Sébastien Theys's avatar Sébastien Theys
Browse files

[FIX] website_sale: prevent issue with test shop_list_view_b2c


It very rarely happens that the test is failing due to the following error:

`Tour shop_list_view_b2c failed at step
.oe_product_cart .oe_currency_value:contains("825.00")`

The value found in that case is 750 instead of 825, which indicates that the b2c
setting was not correctly activated.

To exclude the RPC themselves from the equation, it is decided here to move the
setting change directly in the Python.

closes odoo/odoo#44528

X-original-commit: 3edc88911bf24cd57a27933cf3ffb03a42168bc9
Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
parent 61b7d537
No related branches found
No related tags found
No related merge requests found
odoo.define('website_sale.tour_shop_list_view_b2c', function (require) {
'use strict';
var rpc = require('web.rpc');
var tour = require('web_tour.tour');
tour.register('shop_list_view_b2c', {
......@@ -9,30 +8,6 @@ tour.register('shop_list_view_b2c', {
url: '/shop?search=Test Product',
},
[
{
content: "activate b2c",
trigger: 'body',
run: function () {
return rpc.query({
model: 'res.config.settings',
method: 'create',
args: [{
'auth_signup_uninvited': 'b2c',
'show_line_subtotals_tax_selection': 'tax_included',
'group_show_line_subtotals_tax_excluded': false,
'group_show_line_subtotals_tax_included': true,
}],
}).then(function (resId) {
return rpc.query({
model: 'res.config.settings',
method: 'execute',
args: [[resId]],
}).then(function () {
window.location.reload();
});
});
},
},
{
content: "check price on /shop",
trigger: '.oe_product_cart .oe_currency_value:contains("825.00")',
......
......@@ -208,4 +208,10 @@ class TestUi(odoo.tests.HttpCase):
self.start_tour("/", 'tour_shop_no_variant_attribute', login="demo")
def test_06_admin_list_view_b2c(self):
# activate b2c
config = self.env['res.config.settings'].create({})
config.show_line_subtotals_tax_selection = "tax_included"
config._onchange_sale_tax()
config.execute()
self.start_tour("/", 'shop_list_view_b2c', login="admin")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment