changeset 5e2f5dfc2520 in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset;node=5e2f5dfc2520
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 70cdf0ef43d71517a6bd80fd3b3705d1fec4a536)
diffstat:

 tryton/gui/window/form.py                    |  8 ++++----
 tryton/gui/window/view_form/screen/screen.py |  4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 83cab26ac357 -r 5e2f5dfc2520 tryton/gui/window/form.py
--- a/tryton/gui/window/form.py Sat Dec 28 17:52:30 2019 +0100
+++ b/tryton/gui/window/form.py Mon Jan 20 11:10:51 2020 +0100
@@ -88,11 +88,11 @@
         return (self.model == model
             and self.res_id == attributes.get('res_id')
             and self.attributes.get('domain') == attributes.get('domain')
-            and (self.attributes.get('mode') or []) == (
-                attributes.get('mode') or [])
             and self.attributes.get('view_ids') == attributes.get('view_ids')
-            and self.attributes.get('context') == attributes.get('context')
-            and self.attributes.get('limit') == attributes.get('limit')
+            and (attributes.get('view_ids')
+                or (self.attributes.get('mode') or ['tree', 'form']) == (
+                    attributes.get('mode') or ['tree', 'form']))
+            and self.screen.local_context == attributes.get('context')
             and self.attributes.get('search_value') == (
                 attributes.get('search_value')))
 
diff -r 83cab26ac357 -r 5e2f5dfc2520 
tryton/gui/window/view_form/screen/screen.py
--- a/tryton/gui/window/view_form/screen/screen.py      Sat Dec 28 17:52:30 
2019 +0100
+++ b/tryton/gui/window/view_form/screen/screen.py      Mon Jan 20 11:10:51 
2020 +0100
@@ -257,7 +257,9 @@
                 self.context_screen.display(set_cursor=True)
                 return False
             context = self.local_context
-            context.update(self.context_screen.get_on_change_value())
+            screen_context = self.context_screen.get_on_change_value()
+            screen_context.pop('id')
+            context.update(screen_context)
             self.new_group(context)
 
         domain = self.search_domain(search_string, True)

Reply via email to