ModelStorage __getattr__ small optimizations
ModelStorage.__getattr__ is called millions of times so trying to do some small optimizations can have some impact in many cases.
I tested using a simple loop:
Location = pool.get('stock.location')
loc = Location(1)
for x in range(300000 * 5):
loc.provisioning_location
loc.overflowing_location
The optimizations proposed in the review improve performance by about 16%.