From cafd09a6ab386f3588253c0828775872c92d8583 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 20 Jul 2015 10:22:19 +0200 Subject: [PATCH] Add babi multiprocess patch --- babi_multiprocess.diff | 23 +++++++++++++++++++++++ series | 1 + 2 files changed, 24 insertions(+) create mode 100644 babi_multiprocess.diff diff --git a/babi_multiprocess.diff b/babi_multiprocess.diff new file mode 100644 index 0000000..d26c9a4 --- /dev/null +++ b/babi_multiprocess.diff @@ -0,0 +1,23 @@ +diff -r 75c44f5a88e0 trytond/trytond/protocols/dispatcher.py +--- a/trytond/trytond/protocols/dispatcher.py Mon Jul 20 09:50:24 2015 +0200 ++++ b/trytond/trytond/protocols/dispatcher.py Mon Jul 20 10:21:09 2015 +0200 +@@ -138,7 +138,18 @@ + with Transaction().start(database_name, user, + readonly=True) as transaction: + pool.init() +- obj = pool.get(object_name, type=object_type) ++ try: ++ obj = pool.get(object_name, type=object_type) ++ except KeyError: ++ if object_name[:15] == 'babi_execution_': ++ with Transaction().start(database_name, user, ++ readonly=False) as transaction: ++ Execution = pool.get('babi.report.execution') ++ execution = Execution(int(object_name[15:])) ++ execution.validate_model() ++ obj = pool.get(object_name, type=object_type) ++ else: ++ raise + + if method in obj.__rpc__: + rpc = obj.__rpc__[method] diff --git a/series b/series index 0bc5b8f..ed47bce 100644 --- a/series +++ b/series @@ -57,3 +57,4 @@ issue13211002_190001.diff issue17281002_20001.diff issue20301003_1.diff #invoice_speedup.diff +babi_multiprocess.diff