Exemple #1
0
 def sig_reload(self, test_modified=True):
     if not hasattr(self, 'screen'):
         return False
     if test_modified and self.screen.modified():
         res = sur_3b(_('This record has been modified\n'
                 'do you want to save it ?'))
         if res == 'ok':
             self.sig_save(None)
         elif res == 'ko':
             pass
         else:
             return False
     self.screen.cancel_current()
     set_cursor = False
     if self.screen.current_view.view_type != 'form':
         obj_id = self.id_get()
         self.screen.search_filter(self.screen.screen_container.get_text())
         for record in self.screen.group:
             if record.id == obj_id:
                 self.screen.current_record = record
                 set_cursor = True
                 break
     self.screen.display(set_cursor=set_cursor)
     self.message_info('')
     self.activate_save()
     return True
Exemple #2
0
 def modified_save(self):
     self.screen.current_view.set_value()
     if self.screen.modified():
         value = sur_3b(
             _('This record has been modified\n'
                 'do you want to save it ?'))
         if value == 'ok':
             return self.sig_save(None)
         if value == 'ko':
             return self.sig_reload(test_modified=False)
         return False
     return True
Exemple #3
0
 def modified_save(self):
     self.screen.save_tree_state()
     self.screen.current_view.set_value()
     if self.screen.modified():
         value = sur_3b(
             _('This record has been modified\n'
               'do you want to save it?'))
         if value == 'ok':
             return self.sig_save(None)
         if value == 'ko':
             return self.sig_reload(test_modified=False)
         return False
     return True