Impacted versions: 11.0

Steps to reproduce: Go to Runbot --> Uninstall sale module --> Go to Contacts --> Open one ([Runbot link](http://305507-11-0-5ce76a.runbot13.odoo.com/web/?debug#view_type=kanban&model=res.partner&menu_id=72&action=93))

Current behavior: Traceback on screen
```
Traceback (most recent call last):
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/fields.py", line 936, in __get__
    value = record.env.cache.get(record, self)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/api.py", line 960, in get
    value = self._data[field][record.id][key]
KeyError: <odoo.api.Environment object at 0x7fccc20f0a58>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 647, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 307, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 689, in dispatch
    result = self._call_function(**self.params)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 339, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 332, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 933, in __call__
    return self.method(*args, **kw)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/http.py", line 512, in response_wrap
    response = f(*args, **kw)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/addons/web/controllers/main.py", line 930, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/addons/web/controllers/main.py", line 922, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/models.py", line 2535, in read
    values[name] = field.convert_to_read(record[name], record, use_name_get)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/models.py", line 4675, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/fields.py", line 940, in __get__
    self.determine_value(record)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/fields.py", line 1051, in determine_value
    self.compute_value(recs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/fields.py", line 1007, in compute_value
    self._compute_value(records)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/fields.py", line 998, in _compute_value
    getattr(records, self.compute)()
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/addons/account/models/partner.py", line 294, in _invoice_total
    self.env.cr.execute(query, where_clause_params)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/runbot/extra/runbot/static/build/305507-11-0-5ce76a/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "account_invoice_report" does not exist
LINE 3:                     FROM account_invoice_report account_invo...
                                 ^

```
![](https://image.prntscr.com/image/zFxmxfWIQDaCOFGYg542rQ.png)

Expected behavior: Should open Contact's form View

Video/Screenshot link (optional):
addons/sale/__init__.py
from . import models
from . import controllers
from . import report
from . import wizard
from functools import partial
import odoo
from odoo import api, SUPERUSER_ID
def uninstall_hook(cr, registry):
    def update_dashboard_graph_model(dbname):
        db_registry = odoo.modules.registry.Registry.new(dbname)
        with api.Environment.manage(), db_registry.cursor() as cr:
            env = api.Environment(cr, SUPERUSER_ID, {})
            if 'crm.team' in env:
                recs = env['crm.team'].search([])
                for rec in recs:
                    rec._onchange_team_type()
    cr.after("commit", partial(update_dashboard_graph_model, cr.dbname))