From 687ee84a0dca9553d5ec62298dd72bdff85158b4 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Tue, 7 Jun 2016 11:41:14 +0200 Subject: [PATCH] Remove Screen.parent hack in attachment issue5558 --- issue5558.diff | 33 +++++++++++++++++++++++++++++++++ series | 1 + 2 files changed, 34 insertions(+) create mode 100644 issue5558.diff diff --git a/issue5558.diff b/issue5558.diff new file mode 100644 index 0000000..0b4871b --- /dev/null +++ b/issue5558.diff @@ -0,0 +1,33 @@ +diff -r b38d2dfd7ba4 tryton/tryton/gui/window/attachment.py +--- a/tryton/tryton/gui/window/attachment.py Tue Jun 07 11:25:03 2016 +0200 ++++ b/tryton/tryton/gui/window/attachment.py Tue Jun 07 11:26:00 2016 +0200 +@@ -22,7 +22,6 @@ + ], mode=['tree', 'form'], context=context, + exclude_field='resource') + screen.search_filter() +- screen.parent = record + super(Attachment, self).__init__(screen, self.callback, + view_type='tree') + +diff -r b38d2dfd7ba4 tryton/tryton/gui/window/view_form/screen/screen.py +--- a/tryton/tryton/gui/window/view_form/screen/screen.py Tue Jun 07 11:25:03 2016 +0200 ++++ b/tryton/tryton/gui/window/view_form/screen/screen.py Tue Jun 07 11:26:00 2016 +0200 +@@ -338,7 +338,8 @@ + 'ids': [self.id_get()], + }, context=self.context.copy(), warning=False) + else: +- self.switch_view(view_type='form') ++ if not self.modified(): ++ self.switch_view(view_type='form') + return True + + @property +@@ -347,8 +348,6 @@ + + def switch_view(self, view_type=None): + if self.current_view: +- if not self.parent and self.modified(): +- return + self.current_view.set_value() + if (self.current_record and + self.current_record not in self.current_record.group): diff --git a/series b/series index ae278ec..fdbb308 100644 --- a/series +++ b/series @@ -105,3 +105,4 @@ issue17151002_80001.diff issue5575.diff issue5560_22001002.diff issue5560_23131003.diff +issue5558.diff