Create a server action record that allows user to uninstall many apps at once
Uninstall Modules
Module (type ir_module to get to the right one)
Execute Python code
failed, success, already_done = [], [], []
for r in records:
if r.state == "installed":
try:
r.button_immediate_uninstall()
env.cr.commit()
except:
failed.append(r)
else:
success.append(r)
else:
already_done.append(r)
failed_txt = "the following modules failed to be uninstalled : %s \n" % ', '.join(m.name for m in failed)
success_txt = "the following modules succeeded to be uninstalled : %s \n" % ', '.join(m.name for m in success)
already_done_txt = "the following modules where already uninstalled when their turn came : %s \n" % ', '.join(m.name for m in already_done)
raise UserError(failed_txt + success_txt +already_done_txt + "\n\n Maybe try again the failed ones ?")
Then click "CREATE CONTEXTUAL ACTION"