get_eval must return a list of id for O2M for issue1572
This commit is contained in:
1 parent
3407bbebda
commit
83eefd5837
2 files changed
+7
-1
No files matched your search
@@ -76,6 +76,9 @@ class CharField(object):
|
||||
return self.get(record, check_load=check_load, readonly=True,
|
||||
modified=False)
|
||||
|
||||
def get_on_change_value(self, record, check_load=True):
|
||||
return self.get_eval(record, check_load=check_load)
|
||||
|
||||
def set_client(self, record, value, force_change=False):
|
||||
internal = record.value.get(self.name, False)
|
||||
prev_modified = record.modified
|
||||
@@ -393,6 +396,9 @@ class O2MField(CharField):
|
||||
return result
|
||||
|
||||
def get_eval(self, record, check_load=True):
|
||||
return [x.id for x in record.value.get(self.name) or []]
|
||||
|
||||
def get_on_change_value(self, record, check_load=True):
|
||||
result = []
|
||||
if record.value.get(self.name) is None:
|
||||
return []
|
||||
|
||||
@@ -366,7 +366,7 @@ class Record(SignalEvent):
|
||||
res = {}
|
||||
values = {}
|
||||
for name, field in self.group.fields.iteritems():
|
||||
values[name] = field.get_eval(self, check_load=False)
|
||||
values[name] = field.get_on_change_value(self, check_load=False)
|
||||
if self.parent and self.parent_name:
|
||||
values['_parent_' + self.parent_name] = EvalEnvironment(self.parent,
|
||||
False)
|
||||
|
||||
Reference in new issue
Block a user