本文整理匯總了Python中tryton.gui.window.view_form.screen.Screen.group方法的典型用法代碼示例。如果您正苦於以下問題:Python Screen.group方法的具體用法?Python Screen.group怎麽用?Python Screen.group使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tryton.gui.window.view_form.screen.Screen
的用法示例。
在下文中一共展示了Screen.group方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: open_remote
# 需要導入模塊: from tryton.gui.window.view_form.screen import Screen [as 別名]
# 或者: from tryton.gui.window.view_form.screen.Screen import group [as 別名]
def open_remote(self, record, create=True, changed=False, text=None,
callback=None):
group = record.value[self.field_name]
field = record.group.fields[self.field_name]
relation = field.attrs['relation']
context = field.context_get(record)
screen = Screen(relation, mode=['tree', 'form'],
exclude_field=field.attrs.get('relation_field'))
screen.group = group
def open_callback(result):
if callback:
callback()
WinForm(screen, open_callback, view_type='tree', context=context)
示例2: open_remote
# 需要導入模塊: from tryton.gui.window.view_form.screen import Screen [as 別名]
# 或者: from tryton.gui.window.view_form.screen.Screen import group [as 別名]
def open_remote(self, record, create=True, changed=False, text=None,
callback=None):
group = record.value[self.attrs['name']]
field = record.group.fields[self.attrs['name']]
relation = field.attrs['relation']
context = field.context_get(record)
access = common.MODELACCESS[relation]
if not access['read']:
return
screen = Screen(relation, mode=['tree', 'form'],
exclude_field=field.attrs.get('relation_field'))
screen.pre_validate = bool(int(self.attrs.get('pre_validate', 0)))
screen.group = group
def open_callback(result):
if callback:
callback()
WinForm(screen, open_callback, view_type='tree', context=context)