Reviewers: ,


Please review this at http://codereview.tryton.org/662007/

Affected files:
  M tryton/common/common.py


Index: tryton/common/common.py
===================================================================
--- a/tryton/common/common.py
+++ b/tryton/common/common.py
@@ -1084,6 +1084,14 @@
                 return False
         elif exception.faultCode == 'NotLogged':
             from tryton.gui.main import Main
+            if kwargs.get('session', rpc._SESSION) != rpc._SESSION:
+                if args:
+                    try:
+                        return rpc_execute(*args)
+                    except TrytonServerError, exception:
+                        return process_exception(exception, *args,
+                            rpc_execute=rpc_execute)
+                return
             if not PLOCK.acquire(False):
                 return False
             hostname = rpc._HOST
@@ -1268,6 +1276,7 @@
         return True

     def run(self, process_exception_p=True, main_iteration_p=True):
+        session = rpc._SESSION
         thread.start_new_thread(self.start, ())

         watch = None
@@ -1290,7 +1299,7 @@
                     return RPCProgress('execute',
                         args).run(process_exception_p, main_iteration_p)
                 result = process_exception(self.exception, *self.args,
-                    rpc_execute=rpc_execute)
+                    rpc_execute=rpc_execute, session=session)
                 if result is False:
                     raise RPCException(self.exception)
                 return result


--
--
[email protected] mailing list

--- You received this message because you are subscribed to the Google Groups "tryton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to