From a2dd17ce7ede4025b3930649c0df3fd7b3ef28a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Sat, 31 Aug 2019 01:40:47 +0200 Subject: [PATCH] Do not send empty x2Many fields when saving issue8588 review264091002 --- proteus/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proteus/__init__.py b/proteus/__init__.py index 24fafa62c4..34a899ff68 100644 --- a/proteus/__init__.py +++ b/proteus/__init__.py @@ -893,6 +893,11 @@ class Model(object): if definition.get('readonly') and definition['type'] != 'one2many': continue values[name] = getattr(self, '__%s_value' % name) + # Sending an empty X2Many fields breaks ModelFieldAccess.check + if (definition['type'] in {'one2many', 'many2many'} + and not values[name]): + breakpoint() + del values[name] return values @property