Do not send value for readonly Many2Many

In contrary to One2Many, Many2Many can not be modified when they are readonly.
But Many2Many inherit from One2Many so we must exclude them explicitly from
the test.

issue8323
review275371002
This commit is contained in:
Cédric Krier committed 2019-05-06 13:37:21 +02:00
1 parent 4cc1b194cd
commit 88e1e01b90
1 file changed
+2 -1
+2 -1
View File
@@ -254,7 +254,8 @@ class Record(SignalEvent):
value = {}
for name, field in self.group.fields.items():
if (field.attrs.get('readonly')
and not isinstance(field, fields.O2MField)):
and not (isinstance(field, fields.O2MField)
and not isinstance(field, fields.M2MField))):
continue
if field.name not in self.modified_fields and self.id >= 0:
continue