Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions trytond/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ Version 5.0.0 - 2018-10-01
* Rename "install-dependences" into "activate-dependencies"
* Use recursive common table expression for child_of/parent_of operators
* Add sql_cast on Field
* BUG#9502 Don't auto_uninstall modules

Version 4.8.0 - 2018-04-23
--------------------------
Expand Down
9 changes: 8 additions & 1 deletion trytond/trytond/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

EGG_MODULES = {}

AUTO_UNINSTALL = os.environ.get('COOG_AUTO_UNINSTALL')


def update_egg_modules():
global EGG_MODULES
Expand Down Expand Up @@ -415,8 +417,13 @@ def migrate_modules(cursor):
if (module_in_db in modules_in_dir
or module_in_db in modules_to_migrate):
continue
else:
elif AUTO_UNINSTALL:
logger.warning(f'{module_in_db} is about to be uninstalled')
modules_to_migrate[module_in_db] = ('to_drop', None)
else:
logger.critical(f'To uninstall {module_in_db} you should set '
'COOG_AUTO_UNINSTALL environnement variable')
sys.exit(1)

def rename(cursor, table_name, old_name, new_name, var_name):
table = Table(table_name)
Expand Down