本文整理汇总了Python中tryton.gui.window.view_form.screen.Screen.cancel_current方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.cancel_current方法的具体用法?Python Screen.cancel_current怎么用?Python Screen.cancel_current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tryton.gui.window.view_form.screen.Screen
的用法示例。
在下文中一共展示了Screen.cancel_current方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Form
# 需要导入模块: from tryton.gui.window.view_form.screen import Screen [as 别名]
# 或者: from tryton.gui.window.view_form.screen.Screen import cancel_current [as 别名]
#.........这里部分代码省略.........
if widget:
# Called from button so we must save the tree state
self.screen.save_tree_state()
if not (common.MODELACCESS[self.model]['write']
or common.MODELACCESS[self.model]['create']):
return
if self.screen.save_current():
self.message_info(_('Record saved.'), gtk.MESSAGE_INFO)
return True
else:
self.message_info(self.screen.invalid_message(), gtk.MESSAGE_ERROR)
return False
def sig_previous(self, widget=None):
if not self.modified_save():
return
self.screen.display_prev()
self.message_info()
self.activate_save()
def sig_next(self, widget=None):
if not self.modified_save():
return
self.screen.display_next()
self.message_info()
self.activate_save()
def sig_reload(self, test_modified=True):
if test_modified:
if not self.modified_save():
return False
else:
self.screen.save_tree_state(store=False)
self.screen.cancel_current()
set_cursor = False
record_id = (self.screen.current_record.id
if self.screen.current_record else None)
if self.screen.current_view.view_type != 'form':
self.screen.search_filter(self.screen.screen_container.get_text())
for record in self.screen.group:
if record.id == record_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
def sig_action(self, widget):
if self.buttons['action'].props.sensitive:
self.buttons['action'].props.active = True
def sig_print(self, widget):
if self.buttons['print'].props.sensitive:
self.buttons['print'].props.active = True
def sig_print_open(self, widget):
if self.buttons['open'].props.sensitive:
self.buttons['open'].props.active = True
def sig_print_email(self, widget):
if self.buttons['email'].props.sensitive:
self.buttons['email'].props.active = True
def sig_relate(self, widget):
示例2: Form
# 需要导入模块: from tryton.gui.window.view_form.screen import Screen [as 别名]
# 或者: from tryton.gui.window.view_form.screen.Screen import cancel_current [as 别名]
#.........这里部分代码省略.........
if self.screen.save_current():
self.message_info(_('Record saved!'), 'green')
return True
else:
self.message_info(_('Invalid form!'))
return False
def sig_previous(self, widget=None):
if not self.modified_save():
return
self.screen.display_prev()
self.message_info('')
self.activate_save()
def sig_next(self, widget=None):
if not self.modified_save():
return
self.screen.display_next()
self.message_info('')
self.activate_save()
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
def sig_action(self, widget):
if self.buttons['action'].props.sensitive:
self.buttons['action'].props.active = True
def sig_print(self, widget):
if self.buttons['print'].props.sensitive:
self.buttons['print'].props.active = True
def sig_print_open(self, widget):
if self.buttons['open'].props.sensitive:
self.buttons['open'].props.active = True
def sig_print_email(self, widget):
if self.buttons['email'].props.sensitive:
self.buttons['email'].props.active = True
def sig_relate(self, widget):
if self.buttons['relate'].props.sensitive: