From 5c389c3bb5d3bb521d9d631c28bb923667fde5d1 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 --- 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 1064dfa471..39601c0ba7 100644 --- a/sao/src/view/form.js +++ b/sao/src/view/form.js @@ -2324,34 +2324,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('