Fix session used for downloading CORE archive transactions
This commit is contained in:
parent
62d40b9ba9
commit
79591beec1
|
@ -63,13 +63,16 @@ class TransactionDetailView(TransactionDetailMasterView):
|
|||
return engines
|
||||
|
||||
def make_isolated_session(self):
|
||||
from corepos.db.office_trans import Session as CoreTransArchiveSession
|
||||
app = self.get_rattail_app()
|
||||
corepos = app.get_corepos_handler()
|
||||
|
||||
dbkey = self.get_current_engine_dbkey()
|
||||
if dbkey != 'default' and dbkey in self.rattail_config.core_office_trans_archive_engines:
|
||||
return CoreTransArchiveSession(bind=self.rattail_config.core_office_trans_archive_engines[dbkey])
|
||||
engine = self.rattail_config.core_office_arch_engines.get(dbkey)
|
||||
if not engine:
|
||||
engine = self.rattail_config.core_office_arch_engine
|
||||
assert engine
|
||||
|
||||
return CoreTransArchiveSession()
|
||||
return corepos.make_session_office_arch(bind=engine)
|
||||
|
||||
|
||||
def defaults(config, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue