Impacted versions: 11c, 11e

Steps to reproduce: Install module, uninstall it, then go to action choise delete module (tested with some module: Automated Translations through Gengo API, Vietnam - Accounting...)

Current behavior:
Popup error:
```
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set

[object with reference: Module Uninstallation - base.module.uninstall]
```
--
logs:
```
ERROR: null value in column "module_id" violates not-null constraint
DETAIL:  Failing row contains (1, t, null, 1, 2017-11-06 09:26:04.803957, 1, 2017-11-06 09:26:04.803957).
CONTEXT:  SQL statement "UPDATE ONLY "public"."base_module_uninstall" SET "module_id" = NULL WHERE $1 OPERATOR(pg_catalog.=) "module_id""
```

If module is not installed before, no error occurs

Expected behavior: the module should delete normally
odoo/addons/base/module/module.py
return self.env[model].browse(imd_models[model]).exists()
            def format_view(v):
                return '%s%s (%s)' % (v.inherit_id and '* INHERIT ' or '', v.name, v.type)
            module.views_by_module = "\n".join(sorted(format_view(v) for v in browse('ir.ui.view')))
            module.reports_by_module = "\n".join(sorted(r.name for r in browse('ir.actions.report')))
            module.menus_by_module = "\n".join(sorted(m.complete_name for m in browse('ir.ui.menu')))
    @api.depends('icon')
    def _get_icon_image(self):
        for module in self:
            module.icon_image = ''
            if module.icon:
                path_parts = module.icon.split('/')
                path = modules.get_module_resource(path_parts[1], *path_parts[2:])
            else:
                path = modules.module.get_module_icon(module.name)
            if path:
                with tools.file_open(path, 'rb') as image_file:
                    module.icon_image = base64.b64encode(image_file.read())
    name = fields.Char('Technical Name', readonly=True, required=True, index=True)