From 21b0f35e88426f9c3f5c140df76d3ac751de91ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 7 Nov 2008 00:38:40 +0100 Subject: [PATCH] Add validation before save on select change for editing list view. --- tryton/gui/window/view_form/view/list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 1df6d53586..d35ca7e0ee 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -466,7 +466,8 @@ class ViewList(ParserView): and self.widget_tree.editable \ and self.screen.tree_saves \ and previous_model != self.screen.current_model: - if previous_model and not previous_model.save(): + if previous_model and \ + not (previous_model.validate() and previous_model.save()): self.screen.current_model = previous_model self.set_cursor() return True