17.0 vanilla

This commit is contained in:
Ernad Husremovic 2025-10-03 18:05:14 +02:00
parent 2e65bf056a
commit df627a6bba
328 changed files with 578149 additions and 759311 deletions

View file

@ -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: