diff --git a/addons/account/static/tests/tours/tax_group_tests.js b/addons/account/static/tests/tours/tax_group_tests.js index 42df4a4ef2f..279be69c783 100644 --- a/addons/account/static/tests/tours/tax_group_tests.js +++ b/addons/account/static/tests/tours/tax_group_tests.js @@ -48,17 +48,18 @@ registry.category("web_tour.tours").add('account_tax_group', { { content: "Type item", trigger: 'div[name="invoice_line_ids"] .o_selected_row .o_list_many2one[name="product_id"] input', - run: "text Large Desk", + run: "text Corner Desk Right Sit", }, { content: "Valid item", - trigger: '.ui-menu-item-wrapper:contains("Large Desk")', + trigger: '.ui-menu-item-wrapper:contains("Corner Desk Right Sit")', }, // Save account.move { content: "Save the account move", trigger: '.o_form_button_save', }, + ...stepUtils.saveForm(), // Edit tax group amount { content: "Edit tax group amount", @@ -76,7 +77,7 @@ registry.category("web_tour.tours").add('account_tax_group', { // Check new value for total (with modified tax_group_amount). { content: "Valid total amount", - trigger: 'span[name="amount_total"]:contains("1,499.00")', + trigger: 'span[name="amount_total"]:contains("800")', }, // Modify the quantity of the object { @@ -102,10 +103,11 @@ registry.category("web_tour.tours").add('account_tax_group', { content: "Save the account move", trigger: '.o_form_button_save', }, + ...stepUtils.saveForm(), // Check new tax group value { content: "Check new value of tax group", - trigger: '.o_tax_group_amount_value:contains("389.70")', + trigger: '.o_tax_group_amount_value:contains("120")', }, { content: "Edit tax value", @@ -114,7 +116,7 @@ registry.category("web_tour.tours").add('account_tax_group', { }, { content: "Check new value of total", - trigger: '.oe_subtotal_footer_separator:contains("2,600.00")', + trigger: '.oe_subtotal_footer_separator:contains("1,202")', }, { content: "Discard changes", @@ -122,6 +124,6 @@ registry.category("web_tour.tours").add('account_tax_group', { }, { content: "Check tax value is reset", - trigger: '.o_tax_group_amount_value:contains("389.70")', + trigger: '.o_tax_group_amount_value:contains("120")', }, ]}); diff --git a/addons/account/tests/test_tour.py b/addons/account/tests/test_tour.py index d6c995eb76a..bff8fe9ffe1 100644 --- a/addons/account/tests/test_tour.py +++ b/addons/account/tests/test_tour.py @@ -7,6 +7,20 @@ import odoo.tests @odoo.tests.tagged('post_install_l10n', 'post_install', '-at_install') class TestUi(odoo.tests.HttpCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + all_moves = cls.env['account.move'].search([('move_type', '!=', 'entry')]) + all_moves.button_draft() + all_moves.with_context(force_delete=True).unlink() + + # In case of latam impacting multiple countries, disable the required fields manually. + if 'l10n_latam_use_documents' in cls.env['account.journal']._fields: + cls.env['account.journal']\ + .search([('company_id', '=', cls.env.company.id), ('type', '=', 'purchase')])\ + .write({'l10n_latam_use_documents': False}) + def test_01_account_tour(self): # Reset country and fiscal country, so that fields added by localizations are # hidden and non-required, and don't make the tour crash. @@ -22,18 +36,16 @@ class TestUi(odoo.tests.HttpCase): account_with_taxes.write({ 'tax_ids': [Command.clear()], }) - # This tour doesn't work with demo data on runbot - all_moves = self.env['account.move'].search([('move_type', '!=', 'entry')]) - all_moves.button_draft() - all_moves.with_context(force_delete=True).unlink() - - # In case of latam impacting multiple countries, disable the required fields manually. - if 'l10n_latam_use_documents' in self.env['account.journal']._fields: - self.env['account.journal']\ - .search([('company_id', '=', self.env.company.id), ('type', '=', 'sale')])\ - .write({'l10n_latam_use_documents': False}) self.start_tour("/web", 'account_tour', login="admin") def test_01_account_tax_groups_tour(self): + product = self.env.ref('product.product_product_5') + new_tax = self.env['account.tax'].create({ + 'name': '10% Tour Tax', + 'type_tax_use': 'purchase', + 'amount_type': 'percent', + 'amount': 10, + }) + product.supplier_taxes_id = new_tax self.start_tour("/web", 'account_tax_group', login="admin")