diff --git a/addons/account/static/src/components/tax_totals/tax_totals.js b/addons/account/static/src/components/tax_totals/tax_totals.js index 741b58321a4..a01971eff3f 100644 --- a/addons/account/static/src/components/tax_totals/tax_totals.js +++ b/addons/account/static/src/components/tax_totals/tax_totals.js @@ -143,7 +143,7 @@ export class TaxTotalsComponent extends Component { } formatData(props) { - let totals = props.record.data[this.props.name]; + let totals = structuredClone(props.record.data[this.props.name]); const currencyFmtOpts = { currencyId: props.record.data.currency_id && props.record.data.currency_id[0] }; let amount_untaxed = totals.amount_untaxed; diff --git a/addons/account/static/tests/tours/tax_group_tests.js b/addons/account/static/tests/tours/tax_group_tests.js index 663a82a3fdf..8af2166cf4b 100644 --- a/addons/account/static/tests/tours/tax_group_tests.js +++ b/addons/account/static/tests/tours/tax_group_tests.js @@ -20,21 +20,21 @@ registry.category("web_tour.tours").add('account_tax_group', { }, { content: "Go to Vendors", - trigger: 'a:contains("Vendors")', + trigger: 'span:contains("Vendors")', }, { content: "Go to Bills", - trigger: 'span:contains("Bills")', + trigger: 'a:contains("Bills")', }, { - extra_trigger: '.breadcrumb:contains("Bills")', + extra_trigger: '.o_breadcrumb .text-truncate:contains("Bills")', content: "Create new bill", - trigger: '.o_list_button_add', + trigger: '.o_control_panel_main_buttons .d-none .o_list_button_add', }, // Set a vendor { content: "Add vendor", - trigger: 'div.o_field_widget.o_field_many2one[name="partner_id"] div input', + trigger: 'div.o_field_widget.o_field_res_partner_many2one[name="partner_id"] div input', run: 'text Azure Interior', }, { @@ -48,11 +48,11 @@ registry.category("web_tour.tours").add('account_tax_group', { }, { content: "Select input", - trigger: 'div[name="invoice_line_ids"] .o_list_view .o_selected_row .o_list_many2one:first input', + trigger: 'div[name="invoice_line_ids"] .o_selected_row .o_list_many2one[name="product_id"] input', }, { content: "Type item", - trigger: 'div[name="invoice_line_ids"] .o_list_view .o_selected_row .o_list_many2one:first input', + trigger: 'div[name="invoice_line_ids"] .o_selected_row .o_list_many2one[name="product_id"] input', run: "text Large Desk", }, { @@ -86,16 +86,16 @@ registry.category("web_tour.tours").add('account_tax_group', { // Modify the quantity of the object { content: "Select item quantity", - trigger: 'div[name="invoice_line_ids"] .o_list_view tbody tr.o_data_row .o_list_number[title="1.00"]', + trigger: 'div[name="invoice_line_ids"] tbody tr.o_data_row .o_list_number[name="quantity"]', }, { content: "Change item quantity", - trigger: 'div[name="invoice_line_ids"] .o_list_view tbody tr.o_data_row .o_list_number[title="1.00"] input', + trigger: 'div[name="invoice_line_ids"] tbody tr.o_data_row .o_list_number[name="quantity"] input', run: 'text 2', }, { content: "Valid the new value", - trigger: 'div[name="invoice_line_ids"] .o_list_view tbody tr.o_data_row .o_list_number[title="1.00"] input', + trigger: 'div[name="invoice_line_ids"] tbody tr.o_data_row .o_list_number[name="quantity"] input', run: function (actions) { let keydownEvent = jQuery.Event('keydown'); keydownEvent.which = 13; @@ -112,4 +112,21 @@ registry.category("web_tour.tours").add('account_tax_group', { content: "Check new value of tax group", trigger: '.o_tax_group_amount_value:contains("389.70")', }, + { + content: "Edit tax value", + trigger: '.o_tax_group_edit_input input', + run: 'text 2' + }, + { + content: "Check new value of total", + trigger: '.oe_subtotal_footer_separator:contains("2,600.00")', + }, + { + content: "Discard changes", + trigger: '.o_form_button_cancel', + }, + { + content: "Check tax value is reset", + trigger: '.o_tax_group_amount_value:contains("389.70")', + }, ]}); diff --git a/addons/account/tests/test_tour.py b/addons/account/tests/test_tour.py index d37ef3262c6..d6c995eb76a 100644 --- a/addons/account/tests/test_tour.py +++ b/addons/account/tests/test_tour.py @@ -34,3 +34,6 @@ class TestUi(odoo.tests.HttpCase): .write({'l10n_latam_use_documents': False}) self.start_tour("/web", 'account_tour', login="admin") + + def test_01_account_tax_groups_tour(self): + self.start_tour("/web", 'account_tax_group', login="admin")