trytond-patches/babi_multiprocess.diff

24 lines
994 B
Diff

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]