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-11-12 16:25:02.451033382 +0100
+++ tryton-server/trytond/modules/__init__.py	2015-11-12 16:25:02.451033382 +0100
@@ -378,6 +378,11 @@
         if TableHandler.table_exist(cursor, old_table):
             TableHandler.table_rename(cursor, old_table, new_table)
         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'))))
