[REV] core: handle recursion error when resolving stored fields

This reverts commit 9e71094582ec4c9b719431e77538da8f91ffa9e3.

Why?
- It is useless in 16.0, the bug it claims to fix should not exist. In the
commit explanation the sentence 'this calls `_read`, which flushes the
field we're trying to read' is wrong, since
https://github.com/odoo/odoo/pull/66938 (merged in 15.5). (It is still true
for fields that are in an ir.rule, but it sounds very unlikely to have
a recursive field in ir.rule that causes trigger the problem)
- It creates worst errors (infinite loop for recursive field computation on
missing record - Next commit).
- Also, it looks like a dangerous fix that can hide or trigger new
issues.

X-original-commit: 4a46c1049a4cdc15f0e211d228fb976ba7a0173d
Part-of: odoo/odoo#122147
This commit is contained in:
Rémy Voet (ryv)
2023-05-25 16:29:26 +02:00
parent 64ba10525b
commit 8f600f8a4b
+2 -1
View File
@@ -1178,10 +1178,11 @@ class Field(MetaField('DummyField', (object,), {})):
# not stored and not computed -> default
#
if self.store and record.id:
# real record: fetch from database
recs = record._in_cache_without(self)
try:
recs._fetch_field(self)
except (AccessError, RecursionError):
except AccessError:
if len(recs) == 1:
raise
record._fetch_field(self)