Skip to content
Snippets Groups Projects
user avatar
qsm-odoo authored
When an option notifies that it was used, its ancestor SnippetEditor
instances were in charge of asking for an UI update of all their options
(see [1] where this was already fixed). This was inconsistent with the
logic of our UI where the value of one option might affect the value and
visibility of another option which comes *after* it, e.g.:
- the user sets a badge type to 'info'
     -> the badge background option (below) is shown as blue
- the user adds a shadow
     -> more options are shown afterwards to control it (not above)

After this commit, we now update the whole editor panel (parent and
child options) wherever the updates come from. The only important thing
is to first update the options UI then their visibility as their
visibility may depend on their UI status.

This allows at the same time to fix the source of a race condition, as
enabling a snippet also triggers an UI update whose async parts were not
properly awaited (which thus may lead to inconsistencies if the user
clicked everywhere in the DOM too quickly).

Note: this commit has been made as stable as possible. In master, it
will further be improved (check the forward-ported version).

[1]: https://github.com/odoo/odoo/commit/7623a0c771495cd41bf40af37c0d2b6e4beb7cdc

Part of https://github.com/odoo/odoo/pull/74861



closes odoo/odoo#74861

Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
488b9ae4
History
Name Last commit Last update