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
self.write({'state': 'installed'})
        return True
    @staticmethod
    def get_values_from_terp(terp):
        return {
            'description': terp.get('description', ''),
            'shortdesc': terp.get('name', ''),
            'author': terp.get('author', 'Unknown'),
            'maintainer': terp.get('maintainer', False),
            'contributors': ', '.join(terp.get('contributors', [])) or False,
            'website': terp.get('website', ''),
            'license': terp.get('license', 'LGPL-3'),
            'sequence': terp.get('sequence', 100),
            'application': terp.get('application', False),
            'auto_install': terp.get('auto_install', False),
            'icon': terp.get('icon', False),
            'summary': terp.get('summary', ''),
            'url': terp.get('url') or terp.get('live_test_url', ''),
        }
    @api.model
    def create(self, vals):