changeset e82d64fcd8f0 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=e82d64fcd8f0
description:
        Restore threshold between rebuild and update MPTT

        issue10623
        review350381002
diffstat:

 trytond/model/modelsql.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 6bbc19a57553 -r e82d64fcd8f0 trytond/model/modelsql.py
--- a/trytond/model/modelsql.py Sat Sep 04 19:40:02 2021 +0200
+++ b/trytond/model/modelsql.py Sat Sep 04 19:40:33 2021 +0200
@@ -1472,7 +1472,7 @@
                     'You can not update fields: "%s", "%s"' %
                     (field.left, field.right))
 
-            if len(ids) < 2:
+            if len(ids) < max(cls.count() / 4, 4):
                 for id_ in ids:
                     cls._update_tree(id_, field_name,
                         field.left, field.right)

Reply via email to