本文整理匯總了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