In babi_multiprocess.diff, do not start a new transaction in trytond-admin.
This commit is contained in:
parent
f398b040f9
commit
dc4893ae66
|
@ -1,16 +1,21 @@
|
||||||
diff -r 0bde16075654 trytond/trytond/pool.py
|
diff --git a/trytond/trytond/pool.py b/trytond/trytond/pool.py
|
||||||
--- a/trytond/trytond/pool.py Sun Jul 28 16:05:45 2019 +0200
|
index 407ff358..0be2a41a 100644
|
||||||
+++ b/trytond/trytond/pool.py Fri Aug 16 11:13:08 2019 +0000
|
--- a/trytond/trytond/pool.py
|
||||||
@@ -183,6 +183,12 @@
|
+++ b/trytond/trytond/pool.py
|
||||||
|
@@ -195,6 +195,16 @@ class Pool(object):
|
||||||
self.add(cls, type)
|
self.add(cls, type)
|
||||||
self.setup_mixin(self._modules, type='report', name=name)
|
self.setup_mixin(self._modules, type='report', name=name)
|
||||||
return self.get(name, type=type)
|
return self.get(name, type=type)
|
||||||
+ elif name[:15] == 'babi_execution_':
|
+ elif name[:15] == 'babi_execution_':
|
||||||
+ with Transaction(new=True).start(self.database_name, 0, readonly=False):
|
+ import sys
|
||||||
+ Execution = self.get('babi.report.execution')
|
+ # Do not reload if babi model is accessed during update.
|
||||||
+ execution = Execution(int(name[15:]))
|
+ if not sys.argv[0].endswith('trytond-admin'):
|
||||||
+ execution.validate_model(avoid_registration=True)
|
+ with Transaction(new=True).start(self.database_name, 0,
|
||||||
+ return self._pool[self.database_name][type][name]
|
+ readonly=False):
|
||||||
|
+ Execution = self.get('babi.report.execution')
|
||||||
|
+ execution = Execution(int(name[15:]))
|
||||||
|
+ execution.validate_model(avoid_registration=True)
|
||||||
|
+ return self._pool[self.database_name][type][name]
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def add(self, cls, type='model'):
|
def add(self, cls, type='model'):
|
||||||
|
|
Loading…
Reference in New Issue