trytond-patches/babi_multiprocess.diff

26 lines
923 B
Diff

diff -r 6c0d835dd918 trytond/protocols/dispatcher.py
--- a/trytond/trytond/protocols/dispatcher.py Wed May 11 10:40:32 2016 +0200
+++ b/trytond/trytond/protocols/dispatcher.py Mon May 30 13:24:32 2016 +0200
@@ -159,8 +159,19 @@
type, _ = method.split('.', 1)
name = '.'.join(method.split('.')[1:-1])
method = method.split('.')[-1]
- return pool.get(name, type=type), method
-
+ try:
+ obj = pool.get(name, type=type)
+ except KeyError:
+ if name[:15] == 'babi_execution_':
+ with Transaction().start(pool.database_name, request.user_id,
+ readonly=False):
+ Execution = pool.get('babi.report.execution')
+ execution = Execution(int(name[15:]))
+ execution.validate_model()
+ obj = pool.get(name, type=type)
+ else:
+ raise
+ return obj, method
@app.auth_required
@with_pool