From fac74df68b890a667b2e66f9c8e9f1cee33f17fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 9 Jan 2020 22:35:55 +0100 Subject: [PATCH] Manage empty direction when updating arrows Since issue8880, the direction of order may be null. issue8974 review284691003 --- tryton/gui/window/view_form/view/list.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index 5fc36d7d5e..f9e5755531 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -535,10 +535,11 @@ class ViewTree(View): order = self.screen.order if order and len(order) == 1: (name, direction), = order - direction = { - 'ASC': common.IconFactory.get_pixbuf('tryton-arrow-down'), - 'DESC': common.IconFactory.get_pixbuf('tryton-arrow-up'), - }[direction] + if direction: + direction = { + 'ASC': common.IconFactory.get_pixbuf('tryton-arrow-down'), + 'DESC': common.IconFactory.get_pixbuf('tryton-arrow-up'), + }[direction] else: name, direction = None, None