changeset cbe123462712 in proteus:5.2
details: https://hg.tryton.org/proteus?cmd=changeset;node=cbe123462712
description:
        Do not send empty x2Many fields when saving

        issue8588
        review264091002
        (grafted from 25198402e9f72c848b450c7ca6398fbbc442dcf2)
diffstat:

 proteus/__init__.py |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r db807e3f6b16 -r cbe123462712 proteus/__init__.py
--- a/proteus/__init__.py       Mon May 06 14:46:03 2019 +0200
+++ b/proteus/__init__.py       Sat Aug 31 01:40:47 2019 +0200
@@ -893,6 +893,11 @@
             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

Reply via email to