Revert "[FIX] manual creation of serialized field from the interface"
Non applicable sinceb0646f9d2c. This reverts commit03395ea103.
This commit is contained in:
@@ -850,8 +850,6 @@ class IrModelFields(models.Model):
|
||||
# add compute function if given
|
||||
if field_data['compute']:
|
||||
attrs['compute'] = make_compute(field_data['compute'], field_data['depends'])
|
||||
if field_data.get('sparse'):
|
||||
attrs['sparse'] = field_data['sparse']
|
||||
return attrs
|
||||
|
||||
def _instanciate(self, field_data, partial):
|
||||
|
||||
@@ -215,15 +215,9 @@ class Registry(Mapping):
|
||||
if self._fields_by_model is None:
|
||||
# Query manual fields for all models at once
|
||||
self._fields_by_model = dic = defaultdict(dict)
|
||||
id2name = {}
|
||||
cr.execute('SELECT * FROM ir_model_fields WHERE state=%s', ('manual',))
|
||||
for field in cr.dictfetchall():
|
||||
dic[field['model']][field['name']] = field
|
||||
id2name[field['id']] = field['name']
|
||||
# compute the attribute 'sparse'
|
||||
for fields in dic.values():
|
||||
for name, field in fields.items():
|
||||
field['sparse'] = id2name.get(field['serialization_field_id'])
|
||||
return self._fields_by_model[model_name]
|
||||
|
||||
def do_parent_store(self, cr):
|
||||
|
||||
Reference in New Issue
Block a user