changeset 622699bc9fd6 in sao:5.2
details: https://hg.tryton.org/sao?cmd=changeset;node=622699bc9fd6
description:
Remove id from screen context and compare proper attributes
As mode is not always filled, we must compare only if view_ids is empty
and we
must use the default value as fall-back.
The limit is a local parameter that should not be forced when opening
an URL.
The screen context may be modified thanks to the context model, we must
compare
the current context of the screen instead of the initial one.
issue8977
review272751003
(grafted from 0ded36c933519e15731c3c9742c2c6cee4e85404)
diffstat:
src/screen.js | 5 +++--
src/tab.js | 9 +++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diffs (38 lines):
diff -r 804bf5f71b1d -r 622699bc9fd6 src/screen.js
--- a/src/screen.js Thu Jan 09 15:22:43 2020 +0100
+++ b/src/screen.js Mon Jan 20 11:10:51 2020 +0100
@@ -981,9 +981,10 @@
this.context_screen.display(true);
return jQuery.when();
}
+ var screen_context = this.context_screen.get_on_change_value();
+ delete screen_context.id;
this.new_group(jQuery.extend(
- this.local_context,
- this.context_screen.get_on_change_value()));
+ this.local_context, screen_context));
}
var domain = this.search_domain(search_string, true);
diff -r 804bf5f71b1d -r 622699bc9fd6 src/tab.js
--- a/src/tab.js Thu Jan 09 15:22:43 2020 +0100
+++ b/src/tab.js Mon Jan 20 11:10:51 2020 +0100
@@ -694,13 +694,14 @@
(compare(
this.attributes.domain || [], attributes.domain || [])) &&
(compare(
- this.attributes.mode || [], attributes.mode || [])) &&
- (compare(
this.attributes.view_ids || [],
attributes.view_ids || [])) &&
- (JSON.stringify(this.attributes.context) ===
+ (attributes.view_ids ||
+ (compare(
+ this.attributes.mode || ['tree', 'form'],
+ attributes.mode || ['tree', 'form']))) &&
+ (JSON.stringify(this.screen.local_context) ===
JSON.stringify(attributes.context)) &&
- (this.attributes.limit == attributes.limit) &&
(compare(
this.attributes.search_value || [],
attributes.search_value || []))