pre_validate must not set value and must always validate xxx2many records

issue4330
issue4331
review9841002
This commit is contained in:
Cédric Krier committed 2014-11-19 21:24:25 +01:00
1 parent 5b7c2ff067
commit d84be97b30
1 file changed
+2 -2
+2 -2
View File
@@ -113,7 +113,7 @@ class Field(object):
constraintfields.add(leaf[0])
if localpart != 'id' or recordpart not in constraintfields:
setdefault = False
if setdefault:
if setdefault and not pre_validate:
self.set_client(record, value)
self.get_state_attrs(record)['domain_readonly'] = (
domain_readonly)
@@ -718,7 +718,7 @@ class O2MField(Field):
else:
ldomain = [('id', '=', None)]
for record2 in record.value.get(self.name, []):
if not record2.loaded and record2.id >= 0:
if not record2.loaded and record2.id >= 0 and not pre_validate:
continue
test &= record2.validate(softvalidation=softvalidation,
pre_validate=ldomain)