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
_name = "ir.module.category"
    _description = "Application"
    _order = 'name'
    @api.depends('module_ids')
    def _compute_module_nr(self):
        cr = self._cr
        cr.execute('SELECT category_id, COUNT(*) \
                      FROM ir_module_module \
                     WHERE category_id IN %(ids)s \
                        OR category_id IN (SELECT id \
                                             FROM ir_module_category \
                                            WHERE parent_id IN %(ids)s) \
                     GROUP BY category_id', {'ids': tuple(self.ids)}
                   )
        result = dict(cr.fetchall())
        for cat in self.filtered('id'):
            cr.execute('SELECT id FROM ir_module_category WHERE parent_id=%s', (cat.id,))
            cat.module_nr = sum([result.get(c, 0) for (c,) in cr.fetchall()], result.get(cat.id, 0))
    name = fields.Char(string='Name', required=True, translate=True, index=True)
    parent_id = fields.Many2one('ir.module.category', string='Parent Application', index=True)
    child_ids = fields.One2many('ir.module.category', 'parent_id', string='Child Applications')
    module_nr = fields.Integer(string='Number of Apps', compute='_compute_module_nr')
    module_ids = fields.One2many('ir.module.module', 'category_id', string='Modules')
    description = fields.Text(string='Description', translate=True)
    sequence = fields.Integer(string='Sequence')
    visible = fields.Boolean(string='Visible', default=True)
    exclusive = fields.Boolean(string='Exclusive')
    xml_id = fields.Char(string='External ID', compute='_compute_xml_id')
    def _compute_xml_id(self):