[FIX] base_external_dbsource_sqlite: extend engine selector only after installation

This commit is contained in:
Andrea Cattalani
2023-04-06 13:41:34 +02:00
parent cc92649921
commit e11ea5bd91
2 changed files with 6 additions and 6 deletions

View File

@@ -3,12 +3,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import sqlalchemy
from odoo import models
from odoo.addons.base_external_dbsource.models import base_external_dbsource
CONNECTORS = base_external_dbsource.BaseExternalDbsource.CONNECTORS
CONNECTORS.append(("sqlite", "SQLite"))
from odoo import fields, models
class BaseExternalDbsource(models.Model):
@@ -17,6 +12,9 @@ class BaseExternalDbsource(models.Model):
_inherit = "base.external.dbsource"
PWD_STRING_SQLITE = "Password=%s;"
connector = fields.Selection(
selection_add=[("sqlite", "SQLite")], ondelete={"sqlite": "cascade"}
)
def connection_close_sqlite(self, connection):
return connection.close()

View File

@@ -6,3 +6,5 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* Sergio Teruel
* Andrea Cattalani (`Moduon <https://www.moduon.team/>`__)