Add babi multiprocess patch

This commit is contained in:
Sergi Almacellas Abellana 2015-07-20 10:22:19 +02:00
parent d4a4dc49c3
commit cafd09a6ab
2 changed files with 24 additions and 0 deletions

23
babi_multiprocess.diff Normal file
View File

@ -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]

1
series
View File

@ -57,3 +57,4 @@ issue13211002_190001.diff
issue17281002_20001.diff
issue20301003_1.diff
#invoice_speedup.diff
babi_multiprocess.diff