From 24d6c627e347322d9fdb7e28798e9c8e5fd7406c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 27 Mar 2021 17:48:35 +0100 Subject: [PATCH] Support document display with not field and no record issue10173 --- tryton/gui/window/view_form/view/form_gtk/document.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/document.py b/tryton/gui/window/view_form/view/form_gtk/document.py index e8b4703e39..f6c2ea6b1a 100644 --- a/tryton/gui/window/view_form/view/form_gtk/document.py +++ b/tryton/gui/window/view_form/view/form_gtk/document.py @@ -47,7 +47,10 @@ class Document(BinaryMixin, Widget): def display(self): super().display() - data = self.field.get_data(self.record) + if self.field and self.record: + data = self.field.get_data(self.record) + else: + data = None if not data: self.image.hide()