How to use the tryton.rpc function in tryton

To help you get started, we’ve selected a few tryton examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tryton / tryton / tryton / wizard / main.py View on Github external
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
github tryton / tryton / tryton / gui / window / tree.py View on Github external
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()
github tryton / tryton / tryton / gui / window / view_form / view / form_gtk / action.py View on Github external
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