From 62f175d3d1b7cbe005c817e6e2d53797d2f7710a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 28 Jan 2019 10:03:47 +0100 Subject: [PATCH] Set flavor in SQLite database init and test Those methods use python-sql to make queries but they can be called with a simple connection and not under a Transaction. --- trytond/backend/sqlite/database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trytond/backend/sqlite/database.py b/trytond/backend/sqlite/database.py index 380fd685fe..3f1a88e8f9 100644 --- a/trytond/backend/sqlite/database.py +++ b/trytond/backend/sqlite/database.py @@ -362,6 +362,7 @@ class Database(DatabaseInterface): def init(self): from trytond.modules import get_module_info + Flavor.set(self.flavor) with self.get_connection() as conn: cursor = conn.cursor() sql_file = os.path.join(os.path.dirname(__file__), 'init.sql') @@ -396,6 +397,7 @@ class Database(DatabaseInterface): conn.commit() def test(self, hostname=None): + Flavor.set(self.flavor) tables = ['ir_model', 'ir_model_field', 'ir_ui_view', 'ir_ui_menu', 'res_user', 'res_group', 'ir_module', 'ir_module_dependency', 'ir_translation', 'ir_lang', 'ir_configuration']