## 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

addons/purchase/purchase.py
\n* The \'Cancelled\' status is set automatically when user cancel purchase order.'),
        'invoice_lines': fields.many2many('account.invoice.line', 'purchase_order_line_invoice_rel',
                                          'order_line_id', 'invoice_id', 'Invoice Lines',
                                          readonly=True, copy=False),
        'invoiced': fields.boolean('Invoiced', readonly=True, copy=False),
        'partner_id': fields.related('order_id', 'partner_id', string='Partner', readonly=True, type="many2one", relation="res.partner", store=True),
        'date_order': fields.related('order_id', 'date_order', string='Order Date', readonly=True, type="datetime"),
        'procurement_ids': fields.one2many('procurement.order', 'purchase_line_id', string='Associated procurements'),
    }
    _defaults = {
        'product_uom' : _get_uom_id,
        'product_qty': lambda *a: 1.0,
        'state': lambda *args: 'draft',
        'invoiced': lambda *a: 0,
    }
    _table = 'purchase_order_line'
    _name = 'purchase.order.line'
    _description = 'Purchase Order Line'
    def unlink(self, cr, uid, ids, context=None):
        for line in self.browse(cr, uid, ids, context=context):
            if line.order_id.state in ['approved', 'done'] and line.state not in ['draft', 'cancel']:
                raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a purchase order line which is in state \'%s\'.') %(line.state,))
        procurement_obj = self.pool.get('procurement.order')
        procurement_ids_to_except = procurement_obj.search(cr, uid, [('purchase_line_id', 'in', ids)], context=context)
        if procurement_ids_to_except:
            for po_id in procurement_ids_to_except:
                procurement_obj.message_post(cr, uid, po_id, body=_('Purchase order line deleted.'), context=context)
            procurement_obj.write(cr, uid, procurement_ids_to_except, {'state': 'exception'}, context=context)
        return super(purchase_order_line, self).unlink(cr, uid, ids, context=context)
    def onchange_product_uom(self, cr, uid, ids, pricelist_id, product_id, qty, uom_id,