Description: Migration for obsolete module ldap_connection
 tryton-modules-ldap-connection was merged into
 tryton-modules-ldap-authentication. The server fails to start with a
 missing module, so we remove it from the modules table.
Author: Mathias Behrle <mathiasb@m9s.biz>
Bug: http://bugs.tryton.org/issue4280
Forwarded: https://bugs.tryton.org/issue4280

--- tryton-server-3.4.0.orig/trytond/modules/__init__.py
+++ tryton-server-3.4.0/trytond/modules/__init__.py
@@ -365,8 +365,10 @@ def load_modules(database_name, pool, up
         cursor = Transaction().cursor
         if update:
             # Migration from 2.2: workflow module removed
+            # Migration from 3.2: module ldap_connection removed
+            obsolete_modules = ['workflow', 'ldap_connection']
             cursor.execute(*ir_module.delete(
-                    where=(ir_module.name == 'workflow')))
+                    where=(ir_module.name.in_(obsolete_modules))))
             cursor.execute(*ir_module.select(ir_module.name,
                     where=ir_module.state.in_(('installed', 'to install',
                             'to upgrade', 'to remove'))))
