[FIX] base_external_dbsource_sqlite crashing when sqlparams equal None

This commit is contained in:
Adrià Gil Sorribes
2018-11-13 15:26:17 +01:00
committed by Sergio Teruel
parent 834e0cdfa1
commit 14c3ab3766
2 changed files with 5 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
'name': 'External Database Source - SQLite',
'version': '11.0.1.0.0',
'version': '11.0.1.0.1',
'category': 'Tools',
'author': "Daniel Reis, "
"LasLabs, "

View File

@@ -51,6 +51,9 @@ class BaseExternalDbsource(models.Model):
rows, cols = list(), list()
for record in self:
with record.connection_open() as connection:
if sqlparams is None:
cur = connection.execute(sqlquery)
else:
cur = connection.execute(sqlquery, sqlparams)
if metadata:
cols = list(cur.keys())