[FIX] yaml_import: forward port of saas-12 fixes

fa502dcab8: [FIX] tools: yaml_import: typo
during migration

15835236f2: [FIX] tools: yaml_import: fields
with inverse When importing from yaml do not remove valid values for
computed fields with an inverse method
This commit is contained in:
Thibault Delavallée
2016-07-12 17:49:58 +02:00
parent 631019b865
commit 30b2806e58
+2 -2
View File
@@ -500,7 +500,7 @@ class YamlInterpreter(object):
return {
key: val
for key, val in record_dict.iteritems()
if (key in model._columns or key in model._inherit_fields)
if (key in model._columns or key in model._inherit_fields or model._fields[key].inverse)
}
def process_ref(self, node, field=None):
@@ -518,7 +518,7 @@ class YamlInterpreter(object):
if node.use:
value = [inst[node.use] for inst in instances]
else:
value = instance.ids
value = instances.ids
elif node.id:
if field and field.type == 'reference':
record = self.get_record(node.id)