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

--- tryton-server.orig/trytond/modules/__init__.py	2015-04-23 18:27:43.953539864 +0200
+++ tryton-server/trytond/modules/__init__.py	2015-04-23 18:27:43.953539864 +0200
@@ -368,6 +368,11 @@
         global res
         cursor = Transaction().cursor
         if update:
+            # Migration from 2.2: module workflow removed
+            # Migration from 3.2: module ldap_connection removed
+            obsolete_modules = ['workflow', 'ldap_connection']
+            cursor.execute(*ir_module.delete(
+                    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'))))
