From 6853fd0d34a5d74f5be02f676b5e759f8fe98a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Tue, 29 Sep 2026 15:31:30 +0200 Subject: [PATCH] Set Selection value synchronously when available Restore the displayed value before Window.Form reads the widgets. Otherwise rebuilding the selection may temporarily select its first option. Closes #15117 (grafted from 0fdec92fe79648f3044c5bc10c4dd729a74028fd) --HG-- branch : 8.0 --- sao/src/view/form.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/sao/src/view/form.js b/sao/src/view/form.js index ea2b2bdd26..1d4bb27cbf 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -2319,34 +2319,33 @@ function eval_pyson(value){ return; } var value = field.get(record); - var prm, found = false; + var found = false; for (const option of selection) { if (option[0] === value) { found = true; break; } } - if (!found) { - prm = Sao.common.selection_mixin.get_inactive_selection - .call(this, value); - prm = prm.then(inactive => { - this.select.append(jQuery('