mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 07:52:04 +02:00
17.0 vanilla
This commit is contained in:
parent
2e65bf056a
commit
df627a6bba
328 changed files with 578149 additions and 759311 deletions
|
|
@ -4,6 +4,7 @@ import logging
|
|||
import os
|
||||
import signal
|
||||
import sys
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
import odoo
|
||||
|
|
@ -106,6 +107,7 @@ class Shell(Command):
|
|||
'odoo': odoo,
|
||||
}
|
||||
if dbname:
|
||||
threading.current_thread().dbname = dbname
|
||||
registry = odoo.registry(dbname)
|
||||
with registry.cursor() as cr:
|
||||
uid = odoo.SUPERUSER_ID
|
||||
|
|
@ -113,6 +115,10 @@ class Shell(Command):
|
|||
env = odoo.api.Environment(cr, uid, ctx)
|
||||
local_vars['env'] = env
|
||||
local_vars['self'] = env.user
|
||||
# context_get() has started the transaction already. Rollback to
|
||||
# avoid logging warning "rolling back the transaction before testing"
|
||||
# from odoo.tests.shell.run_tests if the user hasn't done anything.
|
||||
cr.rollback()
|
||||
self.console(local_vars)
|
||||
cr.rollback()
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue