예제 #1
0
파일: wizard.py 프로젝트: xyzlat/tryton
 def destroy(self, action=None):
     super(WizardDialog, self).destroy(action=action)
     self.dia.destroy()
     NoModal.destroy(self)
     main = Main()
     if self.parent == main.window:
         current_form = main.get_page()
         if current_form:
             for dialog in current_form.dialogs:
                 dialog.show()
     if self.page.dialogs:
         dialog = self.page.dialogs[-1]
     else:
         dialog = self.page
     screen = getattr(dialog, 'screen', None)
     if self.sensible_widget == main.window:
         screen = main.menu_screen
     if screen:
         if (screen.current_record and self.sensible_widget != main.window):
             if screen.model_name == self.model:
                 ids = self.ids
             else:
                 # Wizard run from a children record so reload parent record
                 ids = [screen.current_record.id]
             screen.reload(ids, written=True)
         if action:
             screen.client_action(action)
예제 #2
0
 def destroy(self, action=None):
     super(WizardDialog, self).destroy(action=action)
     self.dia.destroy()
     NoModal.destroy(self)
     main = Main()
     if self.parent == main.window:
         current_form = main.get_page()
         if current_form:
             for dialog in current_form.dialogs:
                 dialog.show()
     if self.page.dialogs:
         dialog = self.page.dialogs[-1]
     else:
         dialog = self.page
     screen = getattr(dialog, 'screen', None)
     # JMO: the conditions added on 'reload' are needed
     # for https://support.coopengo.com/issues/12986
     if action != 'reload' and self.sensible_widget == main.window:
         screen = main.menu_screen
     if screen:
         if (screen.current_record and self.sensible_widget != main.window
                 or action == 'reload'):
             if screen.model_name == self.model:
                 ids = self.ids
             else:
                 # Wizard run from a children record so reload parent record
                 ids = [screen.current_record.id]
             screen.reload(ids, written=True)
         if action:
             screen.client_action(action)