Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Add] Allow to uninstall module(s) from command line #12373

Closed
wants to merge 1 commit into from

Conversation

dek-odoo
Copy link
Contributor

@dek-odoo dek-odoo commented Jun 10, 2016

Task: https://www.odoo.com/web?#id=27415&view_type=form&model=project.task&action=327&menu_id=4720

Pad: https://pad.odoo.com/p/r.24e1b44c2f41c1f5cd651bde4944b906

Description of the issue/feature this PR addresses: Allow to uninstall from command line

Current behavior before PR: Sometimes you are not able to get to UI due to some crash and you become helpless, you can not uninstall the culprit module. One module can break the whole system and you have no way of uninstalling the module that caused the problems. For Example, The error "can not parse from bool" which may occur after the upgrade of a module.

Often you dont get UI because of some crash and you are not able to get your system to healthy state.

Usage: ./odoo.py -d db_name --uninstall module_name(s)
(Comma separated list of module_name(s))

Desired behavior after PR is merged: Ability to uninstall module from command line.

One use case: https://youtu.be/7jtmDM0wfFQ

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@mart-e mart-e added the RD research & development, internal work label Jun 10, 2016
@mart-e
Copy link
Contributor

mart-e commented Jun 10, 2016

Do we really want this feature?

@Yenthe666
Copy link
Collaborator

@mart-e I for one would love this feature. Every once in a while it would be handy and faster.

@guewen
Copy link
Contributor

guewen commented Jun 13, 2016

I would love this feature too! In the idea of automated migrations on projects, this is a must-have.

@rim-odoo
Copy link
Contributor

@dek-odoo Is there a task linked to this PR ?

@dek-odoo
Copy link
Contributor Author

No @rim-odoo

@rim-odoo rim-odoo removed the RD research & development, internal work label Jun 13, 2016
@nicobustillos
Copy link
Contributor

Definitely necessary. Sometimes, when a module gives non-trivial errors in the server and you can't go to the modules menu (precisely because of the error), I have to run an update query on the ir_module_module table and set in as 'uninstalled' just so I can recover Odoo service. Or am I missing something?

@josemoralesp
Copy link

This PR will be merged?

@spadae22
Copy link
Contributor

@Yenthe666 I would love this also, since sometimes a modules due to many issues, cannot be removed from the UI. It usually forced you to remove other modules or update the db manually.

@dreispt
Copy link
Contributor

dreispt commented Jul 14, 2016

I believe that this feature is relevant, for practical and for consistency reasons.
And it would allow us (I hope) to uninstall a bad module that is preventing the startup sequence from working correctly - a frequent issue for newbie developers.

@spadae22
Copy link
Contributor

@dreispt +1

@elicoidal
Copy link

👍

@dek-odoo
Copy link
Contributor Author

This is how I do it; for now when I get some problem:

https://youtu.be/7jtmDM0wfFQ

@dek-odoo dek-odoo force-pushed the master-uninstall-from-CLI-dek branch from 8fc274d to 283a7fc Compare July 19, 2016 11:30
@dek-odoo
Copy link
Contributor Author

rebased..

@antonylesuisse antonylesuisse self-assigned this Jul 23, 2016
@C3POdoo C3POdoo added the RD research & development, internal work label Sep 26, 2016
…get UI because of some crash and you are not able to get your system to healthy state
@dek-odoo dek-odoo changed the title [Add] Allow to uninstall module(s) from command line [Add] Allow to uninstall module(s) from command line ✨ Jan 4, 2017
@dek-odoo dek-odoo changed the title [Add] Allow to uninstall module(s) from command line ✨ [Add] Allow to uninstall module(s) from command line Jan 4, 2017
@Fenkiou
Copy link

Fenkiou commented Jan 13, 2017

Any news on this ?

@rim-odoo
Copy link
Contributor

@KangOl ?

@diamark
Copy link

diamark commented Feb 6, 2017

good work. I used the code in a v10 migration to uninstall addons after migration which could not be uninstalled prior to migration due to dependencies.

One thing, though: the mods I wanted to uninstall after migration were all of state 'to upgrade'. I think it makes sense to include that state along with 'installed'. After all, an uninstall cli option should override the upgrade state in the db.

@mart-e mart-e closed this Mar 2, 2017
@mart-e mart-e deleted the master-uninstall-from-CLI-dek branch March 2, 2017 08:18
@mart-e
Copy link
Contributor

mart-e commented Mar 2, 2017

The development was canceled, not going to be integrated

@Yenthe666
Copy link
Collaborator

@mart-e could you give feedback why it was canceled though? Quite some people wanted it, this PR made them happy and now it is cancelled. I'm quite sure there is a good reason though. Could you let us know why?

@mart-e
Copy link
Contributor

mart-e commented Mar 2, 2017

Lots of developments get canceled. This was a side development but not our priority. We refocus from time to time to more urgent work.
Also uninstalling is very dangerous, I don't think it is a good idea to be done very lightly in one command.

@dek-odoo
Copy link
Contributor Author

This is what demotivates me from doing open source contribution. 👎

@Yenthe666
Copy link
Collaborator

@mart-e too bad this got cancelled, this is one of the best PR's in weeks.
If you're argument is that you don't 'think it is a good idea to be done very lightly in one command' you could still add an exta param / question you need to pass before you can do this.

@mart-e
Copy link
Contributor

mart-e commented Mar 20, 2017

This is what demotivates me from doing open source contribution. 👎

@dek-odoo you need to realize that, because somebody spend some time to make a contribution is not a good enough reason to be integrated. The point of opening the contributions from anyone is to make the software better, not to make it fit to every user needs.
We decided (cf task), that this addition was not adding enough value to the product based on the direction we want to give, (e.g. better business flows). So sorry for the time you spent doing so but, at this point, we do not wish to spend even more time on it.

@dreispt
Copy link
Contributor

dreispt commented Mar 20, 2017

@dek-odoo There is a good chance that this PR is accepted at https://github.com/oca/ocb

@dek-odoo
Copy link
Contributor Author

dek-odoo commented Mar 20, 2017

@mart-e Nobody is going to know the actual reason of this PR not being merged. 😄
No problem at all.
Have fun, enjoy.

@dreispt
Thank you, I will, soon.

@gustavovalverde
Copy link
Contributor

gustavovalverde commented May 31, 2017

Too bad it was not accepted, thumps up though. 👍

@dreispt
Copy link
Contributor

dreispt commented Apr 22, 2019

@mart-e any chance this could be reconsidered?

@mart-e
Copy link
Contributor

mart-e commented May 6, 2019

@dreispt will see, I have put the task back to validate but this is a low priority so may take some times before review.

@mart-e
Copy link
Contributor

mart-e commented May 9, 2019

Sorry but after internal discussion, it is still a no.
We do not wish to add commands at the moment, especially for infrequent usecases like uninstall. If this is really needed, it is easy to do it in a oneline shell command like:

$ echo "self.env['ir.module.module'].search([('name', '=', 'crm')]).button_immediate_uninstall()" | python odoo-bin shell -d mydb

@blaggacao
Copy link
Contributor

blaggacao commented May 22, 2019

Try dodoo-migrator https://github.com/xoe-labs/dodoo-migrator ... it's doing a decent enough job for the time being.

@cokotracy
Copy link

Task: https://www.odoo.com/web?#id=27415&view_type=form&model=project.task&action=327&menu_id=4720

Pad: https://pad.odoo.com/p/r.24e1b44c2f41c1f5cd651bde4944b906

Description of the issue/feature this PR addresses: Allow to uninstall from command line

Current behavior before PR: Sometimes you are not able to get to UI due to some crash and you become helpless, you can not uninstall the culprit module. One module can break the whole system and you have no way of uninstalling the module that caused the problems. For Example, The error "can not parse from bool" which may occur after the upgrade of a module.

Often you dont get UI because of some crash and you are not able to get your system to healthy state.

Usage: ./odoo.py -d db_name --uninstall module_name(s)
(Comma separated list of module_name(s))

Desired behavior after PR is merged: Ability to uninstall module from command line.

One use case: https://youtu.be/7jtmDM0wfFQ

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Simply easy and it helps much. I always do the same and if add -u all to consider all modules, you will get the message about all the missing depends of some modules and that is really awesome.

@jjsamayoa
Copy link

update ir_module_module
set state='unistalled'
where id = module_id to uninstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.