本文整理汇总了Python中tryton.gui.window.view_form.screen.Screen.invalid_message方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.invalid_message方法的具体用法?Python Screen.invalid_message怎么用?Python Screen.invalid_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tryton.gui.window.view_form.screen.Screen
的用法示例。
在下文中一共展示了Screen.invalid_message方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Form
# 需要导入模块: from tryton.gui.window.view_form.screen import Screen [as 别名]
# 或者: from tryton.gui.window.view_form.screen.Screen import invalid_message [as 别名]
#.........这里部分代码省略.........
for name in self.screen.current_view.get_fields():
export.sel_field(name)
def sig_new(self, widget=None, autosave=True):
if not common.MODELACCESS[self.model]['create']:
return
if autosave:
if not self.modified_save():
return
self.screen.new()
self.message_info()
self.activate_save()
def sig_copy(self, widget=None):
if not common.MODELACCESS[self.model]['create']:
return
if not self.modified_save():
return
if self.screen.copy():
self.message_info(_('Working now on the duplicated record(s).'),
gtk.MESSAGE_INFO)
def sig_save(self, widget=None):
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