[FIX] account_tour: ensure the form is saved by the end of the tour
Since 54ea956490 the form view has an
"urgent save" fallback mechanism. Even if nothing has changed since
the last (?), it will save during unload, which leads to extra
requests during the browser teardown (deletion of cookies and storage,
navigation to about:blank, ...), which can lead to inconsistent
behaviors and non-deterministic errors.
- add check steps at the end of the tour to wait for relevant terminal
states
- perform an explicit save during the tour (before confirmation)
Ideally we'd really only block on *dirty* forms, because logically the
urgent auto save thing should not trigger if the form is not
dirty. However I'm not sure there's any way to check for that
externally, so saved it is...
Part-of: odoo/odoo#96517
This commit is contained in:
@@ -82,12 +82,11 @@ tour.register('account_tour', {
|
||||
content: _t("Set a price"),
|
||||
position: "bottom",
|
||||
run: 'text 100',
|
||||
}, {
|
||||
},
|
||||
...tour.stepUtils.saveForm(),
|
||||
{
|
||||
trigger: "button[name=action_post]",
|
||||
// FIXME WOWL: this selector needs to work in both legacy and non-legacy views
|
||||
// because account_invoice_extracts *adds* a js_class on the base view which forces
|
||||
// the use of a legacy view in enterprise only
|
||||
extra_trigger: "[name=move_type] [raw-value=out_invoice], [name=move_type][raw-value=out_invoice]",
|
||||
extra_trigger: "button.o_form_button_edit",
|
||||
content: _t("Once your invoice is ready, press CONFIRM."),
|
||||
}, {
|
||||
trigger: "button[name=action_invoice_sent]",
|
||||
@@ -121,6 +120,14 @@ tour.register('account_tour', {
|
||||
extra_trigger: "[name=move_type] [raw-value=out_invoice], [name=move_type][raw-value=out_invoice]",
|
||||
content: _t("Let's send the invoice."),
|
||||
position: "top"
|
||||
}, {
|
||||
trigger: "button[name=action_invoice_sent].btn-secondary",
|
||||
content: _t("The invoice having been sent, the button has changed priority."),
|
||||
run() {},
|
||||
}, {
|
||||
trigger: "button[name=action_register_payment]",
|
||||
content: _t("The next step is payment registration."),
|
||||
run() {},
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user