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

click-odoo-uninstall, search for installed module only #90

Open
GSLabIt opened this issue Mar 8, 2021 · 5 comments
Open

click-odoo-uninstall, search for installed module only #90

GSLabIt opened this issue Mar 8, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@GSLabIt
Copy link

GSLabIt commented Mar 8, 2021

Hi there,

any chance to search for installed module only? It will prevent error if module is not installed.

from:
modules = env["ir.module.module"].search([("name", "in", module_names)])

to:
modules = env["ir.module.module"].search([("name", "in", module_names),('state','=','installed')])

in

modules = env["ir.module.module"].search([("name", "in", module_names)])

@sbidoul
Copy link
Member

sbidoul commented Mar 8, 2021

Hi! What error do you observe? Should we include modules to upgrade too?

@sbidoul sbidoul added the enhancement New feature or request label Mar 8, 2021
@GSLabIt
Copy link
Author

GSLabIt commented Mar 8, 2021

Hi! What error do you observe? Should we include modules to upgrade too?

Error: ('One or more of the selected modules have already been uninstalled, if you believe this to be an error, you may try again later or contact support.', '')

As far as i've seen it is not needed in upgrade

@sbidoul
Copy link
Member

sbidoul commented Mar 9, 2021

What I mean is that a module is in state to upgrade it must be uninstalled too. So the domain you propose (state=installed) is too restrictive. Do you want to make a PR, with a test ?

@GSLabIt
Copy link
Author

GSLabIt commented Mar 9, 2021

What I mean is that a module is in state to upgrade it must be uninstalled too. So the domain you propose (state=installed) is too restrictive. Do you want to make a PR, with a test ?

Oh, I see. so we could use state != 'uninstalled'

@GSLabIt
Copy link
Author

GSLabIt commented Mar 14, 2021

What I mean is that a module is in state to upgrade it must be uninstalled too. So the domain you propose (state=installed) is too restrictive. Do you want to make a PR, with a test ?

I'm willing to make a pr, can u help with tests? 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants