Remove Screen.parent hack in attachment

issue5558
This commit is contained in:
Raimon Esteve 2016-06-07 11:41:14 +02:00
parent ef90c07295
commit 687ee84a0d
2 changed files with 34 additions and 0 deletions

33
issue5558.diff Normal file
View File

@ -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):

1
series
View File

@ -105,3 +105,4 @@ issue17151002_80001.diff
issue5575.diff
issue5560_22001002.diff
issue5560_23131003.diff
issue5558.diff