## Impacted versions:
 8.0 / 9.0 / 10.0
## Steps to reproduce:
* see https://github.com/odoo/odoo/issues/11841
* in a shell
  1. create an in memory record `order = self.env['purcahse.order'].new({....})`
  2. create an in memory record with a reference to the first one `order_line = self.env['purchase.order.line'].new({'order_id': order, ....})`
  3. order_line.order_id is an in memory recordset
  4. create a record for a model that inherits from mail.thread `self.env['product.product'].create({....})`
  5. At this stage order_line.order_id is an empty recordset

## Current behavior:
 In memory records are dropped when a call is done to self.invalidate_cache
## Expected behavior:
In memory records are preserved when a call is done to self.invalidate_cache


There are lot of places where the method `invalidate_cache` is called and the silent removal of the in memory records from all environments has unpredictable effects on fields modified by a computed method or an onchange or even related fields .... Moreover since all caches are invalidated each time you create / write / unlink  (https://github.com/odoo/odoo/blob/10.0/addons/mail/models/mail_followers.py#L111) an instance of a model that inherits from 'mail.thread', the performances of the server are severely penalized.

OPW703903

list_key.sort()
            return tuple(list_key)
        context = dict(context or {})
        
        new_orders = {}
        order_lines_to_move = {}
        for porder in [order for order in self.browse(cr, uid, ids, context=context) if order.state == 'draft']:
            order_key = make_key(porder, ('partner_id', 'location_id', 'pricelist_id', 'currency_id'))
            new_order = new_orders.setdefault(order_key, ({}, []))
            new_order[1].append(porder.id)
            order_infos = new_order[0]
            order_lines_to_move.setdefault(order_key, [])
            if not order_infos:
                order_infos.update({
                    'origin': porder.origin,
                    'date_order': porder.date_order,
                    'partner_id': porder.partner_id.id,
                    'dest_address_id': porder.dest_address_id.id,
                    'picking_type_id': porder.picking_type_id.id,
                    'location_id': porder.location_id.id,
                    'pricelist_id': porder.pricelist_id.id,
                    'currency_id': porder.currency_id.id,
                    'state': 'draft',
                    'order_line': {},
                    'notes': '%s' % (porder.notes or '',),
                    'fiscal_position': porder.fiscal_position and porder.fiscal_position.id or False,
                })
            else:
                if porder.date_order < order_infos['date_order']:
                    order_infos['date_order'] = porder.date_order