changeset 1748347abb2f in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=1748347abb2f
description:
        Add context to export URL

        issue9304
        review317361002
diffstat:

 CHANGELOG                       |  2 ++
 tryton/common/common.py         |  8 +++-----
 tryton/gui/window/preference.py |  1 +
 3 files changed, 6 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 45847cddc690 -r 1748347abb2f CHANGELOG
--- a/CHANGELOG Sun May 10 11:21:25 2020 +0200
+++ b/CHANGELOG Tue May 19 18:57:53 2020 +0200
@@ -1,3 +1,5 @@
+* Use existing context for get_preferences
+
 Version 5.6.0 - 2020-05-04
 * Bug fixes (see mercurial logs for details)
 * Support link button on form
diff -r 45847cddc690 -r 1748347abb2f tryton/common/common.py
--- a/tryton/common/common.py   Sun May 10 11:21:25 2020 +0200
+++ b/tryton/common/common.py   Tue May 19 18:57:53 2020 +0200
@@ -1081,11 +1081,9 @@
             pass
         if callback:
             callback()
-    # Use RPCProgress to not send rpc.CONTEXT
-    context = RPCProgress(
-        'execute',
-        ('model', 'res.user', 'get_preferences', True, {})).run(
-            True, update if callback else None)
+    context = RPCExecute(
+        'model', 'res.user', 'get_preferences', True,
+        callback=update if callback else None)
     if not callback:
         rpc.context_reset()
         rpc.CONTEXT.update(context)
diff -r 45847cddc690 -r 1748347abb2f tryton/gui/window/preference.py
--- a/tryton/gui/window/preference.py   Sun May 10 11:21:25 2020 +0200
+++ b/tryton/gui/window/preference.py   Tue May 19 18:57:53 2020 +0200
@@ -101,6 +101,7 @@
                     RPCExecute('model', 'res.user', 'set_preferences', vals)
                 except RPCException:
                     return
+                rpc.context_reset()
         self.parent.present()
         self.destroy()
         self.callback()

Reply via email to