Skip to content

Commit

Permalink
Merge pull request #26 from acsone/fix_uninstall_bug
Browse files Browse the repository at this point in the history
[FIX] Fix bug after uninstalling a connector module
  • Loading branch information
sebastienbeau committed Jul 27, 2018
2 parents 9a48e5c + 04afda4 commit 084f6ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion connector_search_engine/models/se_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ def _get_specific_backend_selection(self):
vals = []
s = self.with_context(active_test=False)
for model, descr in spec_backend_selection:
if model in s.env:
# We have to check if the table really exist.
# Because in the case of the user uninstall a connector_XXX module
# with a new se.backend (so who adds a new element into selection
# field), no more se.backend will be available (because the
# selection field still filled with the previous model and Odoo
# try to load the model).
if model in s.env and s.env[model]._table_exist():
records = s.env[model].search([])
for record in records:
vals.append((model, record.id))
Expand Down

0 comments on commit 084f6ba

Please sign in to comment.