Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
email=email, context=ctx)
datas['ids'] = backup_ids
else:
Action.exec_report(res['report'], datas, dia or parent,
direct_print=direct_print, email_print=email_print,
email=email, context=ctx)
state = res['state']
elif res['type'] == 'state':
state = res['state']
if dia:
dia.destroy()
dia = None
try:
rpc.execute('wizard', action, 'delete', wiz_id, rpc.CONTEXT)
#XXX to remove when company displayed in status bar
rpc.context_reload()
except TrytonServerError:
pass
def menu_main_clicked(self, widget, focus=True):
if widget.get_active():
obj_id = widget.get_data('id')
args = ('model', self.model, 'read', obj_id,
[self.view['field_childs']], rpc.CONTEXT)
try:
ids = rpc.execute(*args)[self.view['field_childs']]
except Exception, exception:
res = common.process_exception(exception, self.window, *args)
if not res:
return False
ids = res[self.view['field_childs']]
if not ids:
return False
self.tree_res.ids = ids
self.tree_res.reload()
self.sig_action('tree_open', obj_id=obj_id, warning=False)
if focus:
if self.tree_res.view.get_model().get_iter_root():
self.tree_res.view.grab_focus()
selection = self.tree_res.view.get_selection()
def display(self, model, model_field):
try:
res_id = rpc.execute('object', 'execute',
self.action['res_model'], 'search', self.domain, 0,
self.action.get('limit', 80))
except Exception, exception:
rpc.process_exception(exception, self._window)
return False
self.screen.clear()
self.screen.load(res_id)
return True