changeset e6e553bfde14 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=e6e553bfde14
description:
        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.
diffstat:

 trytond/backend/sqlite/database.py |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 00a9f1234b47 -r e6e553bfde14 trytond/backend/sqlite/database.py
--- a/trytond/backend/sqlite/database.py        Mon Jan 28 09:15:33 2019 +0100
+++ b/trytond/backend/sqlite/database.py        Mon Jan 28 10:03:47 2019 +0100
@@ -362,6 +362,7 @@
 
     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 @@
             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']

Reply via email to