From 80f60b55f4ea8558cd6e856d796dfe9664e79bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 9 Mar 2018 19:13:51 +0100 Subject: [PATCH] Use limit to expand tree The screen switch to the form view if the limit is reached. issue4901 review44641002 --- CHANGELOG | 1 + tryton/gui/window/view_form/view/list.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 9cc374f13c..2cf34ee4b2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Use limit to expand tree * Add keyword attribute to button tag * Support field name on image tag * Add option to check new version diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 9d657743ff..dc947c646f 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -653,6 +653,10 @@ class ViewTree(View): def test_expand_row(self, widget, iter_, path): model = widget.get_model() + if model.iter_n_children(iter_) > CONFIG['client.limit']: + self.screen.current_record = model.get_value(iter_, 0) + self.screen.switch_view('form') + return True iter_ = model.iter_children(iter_) if not iter_: return False