changeset 8e9eada53048 in sao:5.0
details: https://hg.tryton.org/sao?cmd=changeset;node=8e9eada53048
description:
Ensure to put search_value in URL
If the screen container or the domain parser are not yet ready to
compute the
search_value, we should ensure to use the initial search_value.
Otherwise sao
may trigger to open a new tab without the search_value because the URL
will be
set with an empty search.
issue8267
review281471002
(grafted from fe2a9a26fec4f16a12077ae0a8de50843d7d73e9)
diffstat:
src/screen.js | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 8ba9c7020a8b -r 8e9eada53048 src/screen.js
--- a/src/screen.js Mon May 13 22:38:11 2019 +0200
+++ b/src/screen.js Thu May 02 12:46:37 2019 +0200
@@ -972,6 +972,7 @@
domain = domain_parser.parse(search_string);
} else {
domain = this.attributes.search_value;
+ this.attributes.search_value = null;
}
if (set_text) {
this.screen_container.set_text(
@@ -1839,8 +1840,13 @@
var view_ids = this.views.map(
function(v) {return v.view_id;}).concat(this.view_ids);
if (this.current_view.view_type != 'form') {
- var search_string = this.screen_container.get_text();
- var search_value = this.domain_parser().parse(search_string);
+ var search_value;
+ if (this.attributes.search_value) {
+ search_value = this.attributes.search_value;
+ } else {
+ var search_string = this.screen_container.get_text();
+ search_value = this.domain_parser().parse(search_string);
+ }
if (!jQuery.isEmptyObject(search_value)) {
query_string.push(['search_value', dumps(search_value)]);
}