A common pattern is to access a
Many2One with a context (ex:
account.move.line with the
company set in the context).
ModelStorage.__getattr__ is not efficient because if the
Many2One is already in the
_cache then it skip eager load. But indeed it will need to also read the fields in the context which may not be in the
_cache (ex: the
account.move.line which is a
Function field). In this case we re-read one by one the field and the context fields if at least one is not in
For me we should skip eager loading only if the accessed field has no context (and neither the datetime field).
Also we should filter out only sibling ids if all the read fields are not in any of the transaction and local cache.
This way we make an extra read but for all the siblings at once instead of one by one and we instantiate all the
Many2One at once and store them in the local cache.
|2022-05-13 00:01:09||ced||set||messageid: <1652392869.3356092.S2QHKXND53YDR3Z6.email@example.com>|
|2022-05-13 00:01:09||ced||link||issue11481 messages|
Showing 10 items. Show all history (warning: this could be VERY long)