On large recordsets I got some severe performance issues while browsing through an inherits relation.
For example I have a batch process exporting a csv file with products variants:

I have to export 50.000 products.

If I do :
`variant.categ_id` It takes a very long time to get the result.

If I do:
`variant.product_tmpl_id.categ_id` The result is immediate

The problem is that the global perfomance of the application is impacted by this problem.

For example my POS takes more than 15 minutes to load. Because I have 26.000 products and the compute price method uses a lot browsing through the inherits such like `product.cated_id`, `product.uom_id` and they all takes a huge time to compute.

Same issue in this case.

If I do :
`variant.price` It takes a very long time to get the result.

If I do:
`variant.product_tmpl_id.price` The result is immediate

Could you help me ?


Simple way to reproduce:

1/ Create a new database and install sale module
2/ Launch following script through odoo shell :

```python
# -*- coding: utf-8 -*-
import logging

_logger = logging.getLogger(__name__)
self = self  # noqa

nb_product = 50000

i = 0
while i < nb_product:
    prod = self.env['product.template'].create({'name': 'product_%s' % i})
    i += 1
    if i % 1000 == 0:
        self.env.cr.commit()
        _logger.info("%s Products Created" % i)
```

2/ Launch following script through odoo shell :
```python
# -*- coding: utf-8 -*-
import logging

_logger = logging.getLogger(__name__)
self = self  # noqa


products = self.env['product.product'].search([])

for product in products:
    # Immediate response
    _logger.info('Category Template %s' % product.product_tmpl_id.categ_id)
    # Lagging response
    _logger.info('Category Variant %s' % product.categ_id) 
    break
```
methods. Their signature is shown in the following example::
            upper = fields.Char(compute='_compute_upper',
                                inverse='_inverse_upper',
                                search='_search_upper')
            @api.depends('name')
            def _compute_upper(self):
                for rec in self:
                    rec.upper = rec.name.upper() if rec.name else False
            def _inverse_upper(self):
                for rec in self:
                    rec.name = rec.upper.lower() if rec.upper else False
            def _search_upper(self, operator, value):
                if operator == 'like':
                    operator = 'ilike'
                return [('name', operator, value)]
        The compute method has to assign the field on all records of the invoked
        recordset. The decorator :meth:`odoo.api.depends` must be applied on
        the compute method to specify the field dependencies; those dependencies
        are used to determine when to recompute the field; recomputation is
        automatic and guarantees cache/database consistency. Note that the same
        method can be used for several fields, you simply have to assign all the
        given fields in the method; the method will be invoked once for all
        those fields.
        By default, a computed field is not stored to the database, and is
        computed on-the-fly. Adding the attribute ``store=True`` will store the
        field's values in the database. The advantage of a stored field is that
        searching on that field is done by the database itself. The disadvantage
        is that it requires database updates when the field must be recomputed.
        The inverse method, as its name says, does the inverse of the compute
        method: the invoked records have a value for the field, and you must