Tryton - Issues



Title Uninstall Modules
Priority feature Status chatting
Superseder Nosy List bvo, guillemNaN, pokoli, resteve, tshepang, udono
Type feature request Components
Assigned To Keywords
Reviews 7881002
View: 7881002

Created on 2008-09-04.18:52:36 by udono, last changed by pokoli.

msg23157 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2015-11-16.09:44:41
Not completly resolved.
msg23155 (view) Author: [hidden] (resteve) Date: 2015-11-15.23:20:49
New changeset 04586dcd1fb0 by Guillem Barba in branch 'default':
Recover uninstall modules feature
msg19587 (view) Author: [hidden] (guillemNaN) Date: 2015-01-14.13:49:08
I uploaded a mini review that recover the already implemented "uninstall module" feature.
As it is discussed in this issue, the "uninstall module" feature should be improved but the current implementation is useful becuase remove and other related records which is required to remove deprecated modules like "ldap_connection"
msg6090 (view) Author: [hidden] (udono) Date: 2010-04-10.15:52:10
Here I found some useful code for migrations from the django project:

msg1316 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2008-09-10.17:46:35
A solution could be to add a script in the __tryton__py that will make the
cleaning. And we can allow only modules that have an unistall script to be
msg1244 (view) Author: [hidden] (udono) Date: 2008-09-07.17:19:51
1. But the information on constraints is inside the module. If the module
introduce a new constraints, then they need to be removed when the module is
2. But isn't it possible to remove the references with DELETE CASCADE. Another
way could be catching the error and give a qualified error message like: "The
reference (%s) you try to open point to an unknown model %s. This could be an
error in the actual Model or a remaining reference from an formerly installed
module." % (, reference.model)

What about uninstall scripts inside a module, which will applicated when a
module is going to be uninstalled. These uninstall scripts needs to be very
specific and hardcoded, but could be able removing mostly everything the module
introduce. There we can solve maybe parts of problem 1 and problem 3. 

Another idea could be model states: uninstalled, installed, removed. In the
state removed the module could let some dummy model classes to catch reference
errors. In fact a module once installed cant be anymore in state 'uninstalled'
it has every time the state removed. This state changes when the module is
installed again.

I don't understand the module/init/update/upgrade/remove process this well, but
I haven't had this much problems with the old style uninstall. So I can not
really understand why you remove this function. 
Are there really problems with uninstallation or is it just to catch possible
future problems. The missing uninstall function is contrary to the modularity
aspect of Tryton.
msg1229 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2008-09-05.16:31:57
1. It is not easy to know if a constraint can be drop because it can be used by
others modules.
2. It is not a problem of table columns because reference field are filled like
this: object_name,object_id. So if the object_name doesn't exist, the user will
have error message when he want to open it.
3. It is not depending modules but all the modules, and it will not solve the
problem because the update process will not update it because it will think that
the record have been modified by other modules (which is true) but it doesn't
know that this one have been uninstalled. And there will be also others modules
that can update the same record. So it is a really complicate job.
msg1225 (view) Author: [hidden] (udono) Date: 2008-09-05.15:47:51
1. May it possible to uninstall just the constraint, but leave the column. Like 
ALTER TABLE module_table DROP CONSTRAINT module_attribute;
ALTER TABLE module_table ALTER COLUMN module_attribute DROP NOT NULL;
2. Maybe just leave the Table columns.
3. Maybe just update all depending modules after un-installation a module.
msg1211 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2008-09-04.23:39:19
Some issues about uninstalling modules:

- if the module add fields on table that have constraint, so uninstalling the
module will let the constraint on the table and it will be no more possible to
insert record into the table;

- if there is some reference field that point to an record from a model that
must be uninstalled;

- if the module override a xml record from an other module, the value of this
record can become inconsistent;
msg1210 (view) Author: [hidden] (udono) Date: 2008-09-04.18:52:36
How we can get back the uninstall function for Modules?
Maybe we collect here what exactly is the problem with uninstalling.
Date User Action Args
2015-11-16 09:44:42pokolisetstatus: resolved -> chatting
messages: + msg23157
2015-11-15 23:20:50restevesetstatus: chatting -> resolved
messages: + msg23155
2015-02-03 09:33:46cedsetkeyword: - review
2015-01-15 12:55:05restevesetnosy: + resteve
2015-01-14 13:49:09guillemNaNsetstatus: deferred -> chatting
reviews: 7881002
messages: + msg19587
keyword: + review
2015-01-14 12:54:52pokolisetnosy: + pokoli
2015-01-14 12:50:04guillemNaNsetnosy: + guillemNaN
2015-01-03 23:06:00cedlinkissue4450 superseder
2014-10-21 23:44:16bvosetnosy: + bvo
2011-05-06 18:12:41tshepangsetnosy: + tshepang

Showing 10 items. Show all history (warning: this could be VERY long)