[FIX] core: read model from field in field_compute
Oversight of "simple refactoring" in 634775bff6d9eba9d4548cc801071a942895a719 closes odoo/odoo#51158 X-original-commit: 046b0dedda8f43e4ae13958a34a446e8a73c8d3f Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
committed by
Raphael Collet
parent
fbfe9109e2
commit
8ad7e7cb91
@@ -270,7 +270,7 @@ class Registry(Mapping):
|
||||
def field_computed(self):
|
||||
""" Return a dict mapping each field to the fields computed by the same method. """
|
||||
computed = {}
|
||||
for Model in self.models.values():
|
||||
for model_name, Model in self.models.items():
|
||||
groups = defaultdict(list)
|
||||
for field in Model._fields.values():
|
||||
if field.compute:
|
||||
@@ -279,7 +279,7 @@ class Registry(Mapping):
|
||||
for fields in groups.values():
|
||||
if len({field.compute_sudo for field in fields}) > 1:
|
||||
_logger.warning("%s: inconsistent 'compute_sudo' for computed fields: %s",
|
||||
self._name, ", ".join(field.name for field in fields))
|
||||
model_name, ", ".join(field.name for field in fields))
|
||||
return computed
|
||||
|
||||
@lazy_property
|
||||
|
||||
Reference in New Issue
Block a user