[FIX] core: env creation broken because of missing cr.transaction
A cursor created by a Connection object is not expected to be used with environments; use registry.cursor() instead. closes odoo/odoo#78143 X-original-commit: 6aeb73f10953f3547b7cf830718c02a3933df9e0 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
India, 2021-10-09
|
||||

|
||||
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||
Agreement v1.0.
|
||||

|
||||
I declare that I am authorized and able to make this agreement and sign this
|
||||
declaration.
|
||||

|
||||
Signed,
|
||||

|
||||
Albin John albin_john@tutamail.com https://github.com/Albin-John
|
||||
+1
-1
@@ -62,7 +62,7 @@ def _initialize_db(id, db_name, demo, lang, user_password, login='admin', countr
|
||||
|
||||
registry = odoo.modules.registry.Registry.new(db_name, demo, None, update_module=True)
|
||||
|
||||
with closing(db.cursor()) as cr:
|
||||
with closing(registry.cursor()) as cr:
|
||||
env = odoo.api.Environment(cr, SUPERUSER_ID, {})
|
||||
|
||||
if lang:
|
||||
|
||||
Reference in New Issue
Block a user