Clear xxx2many when there is no field for issue1708
This commit is contained in:
1 parent
e4c6feb99b
commit
4ea978ba88
3 files changed
+9
-3
No files matched your search
@@ -50,8 +50,7 @@ class Screen(SignalEvent):
|
||||
self.parent_name = None
|
||||
self.__window = window
|
||||
self.__group = None
|
||||
self.group = Group(model_name, {}, self.window, context=self.context,
|
||||
readonly=readonly)
|
||||
self.new_group()
|
||||
self.__current_record = None
|
||||
self.current_record = None
|
||||
self.screen_container = ScreenContainer()
|
||||
@@ -178,6 +177,10 @@ class Screen(SignalEvent):
|
||||
|
||||
group = property(__get_group, __set_group)
|
||||
|
||||
def new_group(self, readonly=False):
|
||||
self.group = Group(self.model_name, {}, self.window,
|
||||
context=self.context, readonly=readonly)
|
||||
|
||||
def _group_cleared(self, group, signal):
|
||||
for view in self.views:
|
||||
if hasattr(view, 'reload'):
|
||||
|
||||
@@ -151,7 +151,9 @@ class Many2Many(WidgetInterface):
|
||||
def display(self, record, field):
|
||||
super(Many2Many, self).display(record, field)
|
||||
if field is None:
|
||||
self.screen.new_group()
|
||||
self.screen.current_record = None
|
||||
self.screen.parent = True
|
||||
self.screen.display()
|
||||
return False
|
||||
new_group = field.get_client(record)
|
||||
|
||||
@@ -5,7 +5,6 @@ import gettext
|
||||
from tryton.common import TRYTON_ICON, COLOR_SCHEMES
|
||||
from interface import WidgetInterface
|
||||
from tryton.gui.window.view_form.screen import Screen
|
||||
from tryton.gui.window.view_form.model.group import Group
|
||||
from tryton.gui.window.win_search import WinSearch
|
||||
from tryton.gui.window.win_form import WinForm
|
||||
from tryton.gui.window.view_form.widget_search.form import _LIMIT
|
||||
@@ -324,7 +323,9 @@ class One2Many(WidgetInterface):
|
||||
def display(self, record, field):
|
||||
super(One2Many, self).display(record, field)
|
||||
if field is None:
|
||||
self.screen.new_group()
|
||||
self.screen.current_record = None
|
||||
self.screen.parent = True
|
||||
self.screen.display()
|
||||
return False
|
||||
new_group = field.get_client(record)
|
||||
|
||||
Reference in new issue
Block a user