details: https://code.tryton.org/tryton/commit/fbd3ddd36ceb
branch: 7.0
user: Cédric Krier <[email protected]>
date: Fri Aug 21 10:04:05 2026 +0200
description:
Cache the help with the selection per domain in selection mixin
Closes #15031
(grafted from 1439af7bdd4c87f1bb9761f722c4320e572fde80)
diffstat:
sao/src/common.js | 6 +++---
tryton/tryton/common/selection.py | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diffs (46 lines):
diff -r 23d83d9f3996 -r fbd3ddd36ceb sao/src/common.js
--- a/sao/src/common.js Fri Aug 21 15:26:56 2026 +0200
+++ b/sao/src/common.js Fri Aug 21 10:04:05 2026 +0200
@@ -822,9 +822,9 @@
var context = field.get_context(record);
var jdomain = JSON.stringify([domain, context]);
if (jdomain in this._domain_cache) {
- let selection = this._domain_cache[jdomain];
+ let [selection, help] = this._domain_cache[jdomain];
if (callback) {
- callback(selection, {});
+ callback(selection, help);
}
return;
}
@@ -852,7 +852,7 @@
help[x.id] = x[help_field];
}
}
- this._domain_cache[jdomain] = selection;
+ this._domain_cache[jdomain] = [selection, help];
let cur_domain = field.get_domain(record);
let cur_context = field.get_context(record);
diff -r 23d83d9f3996 -r fbd3ddd36ceb tryton/tryton/common/selection.py
--- a/tryton/tryton/common/selection.py Fri Aug 21 15:26:56 2026 +0200
+++ b/tryton/tryton/common/selection.py Fri Aug 21 10:04:05 2026 +0200
@@ -62,7 +62,8 @@
context = field.get_context(record)
domain_cache_key = (freeze_value(domain), freeze_value(context))
if domain_cache_key in self._domain_cache:
- self.selection = self._domain_cache[domain_cache_key]
+ self.selection, self.help = (
+ self._domain_cache[domain_cache_key])
self._last_domain = (domain, context)
if (domain, context) == self._last_domain:
return
@@ -85,7 +86,7 @@
else:
help_ = {}
self._last_domain = (domain, context)
- self._domain_cache[domain_cache_key] = selection
+ self._domain_cache[domain_cache_key] = (selection, help_)
else:
selection = []
if self.nullable_widget: