def METHOD_NAME(self):
    """Set all selected modules and actually install them."""
    self.ensure_one()
    self.module_ids.write({"state": "to install"})
    self.env.cr.commit()  # pylint: disable=invalid-commit
    Registry.new(self.env.cr.dbname, update_module=True)
    self.write({"state": "done"})
    return self.return_same_form_view()