Exemple #1
0
    def do_action(self, name, adds={}, datas={}):
        params, data = TinyDict.split(datas)

        model = params.model
        context = params._terp_context or {}
        ids = data.get('ids') or []

        ctx = rpc.session.context.copy()
        ctx.update(context)

        if ids:
            ids = map(int, ids.split(','))

        id = (ids or False) and ids[0]

        if ids:
            return actions.execute_by_keyword(name,
                                              adds=adds,
                                              model=model,
                                              id=id,
                                              ids=ids,
                                              context=ctx,
                                              report_type='pdf')
        else:
            raise common.message(_("No record selected"))
Exemple #2
0
    def do_action(self, name, adds={}, datas={}):
        params, data = TinyDict.split(datas)

        model = params.model

        id = params.id or False
        ids = params.selection or params.ids or []

        if params.view_type == 'form':
            #TODO: save current record
            ids = (id or []) and [id]

        if id and not ids:
            ids = [id]

        if len(ids):
            import actions
            return actions.execute_by_keyword(name,
                                              adds=adds,
                                              model=model,
                                              id=id,
                                              ids=ids,
                                              report_type='pdf')
        else:
            raise common.message(_("No record selected"))
Exemple #3
0
    def do_action(self, name, adds={}, datas={}):
        params, data = TinyDict.split(datas)

        model = params.model

        id = params.id or False
        ids = params.selection or params.ids or []

        if params.view_type == 'form':
            #TODO: save current record
            ids = (id or []) and [id]

        if id and not ids:
            ids = [id]

        if len(ids):
            import actions
            return actions.execute_by_keyword(name, adds=adds, model=model, id=id, ids=ids, report_type='pdf')
        else:
            raise common.message(_("No record selected"))    
Exemple #4
0
    def do_action(self, name, adds={}, datas={}):
        params, data = TinyDict.split(datas)

        model = params.model
        context = params._terp_context or {}
        ids = data.get('ids') or []

        ctx = rpc.session.context.copy()
        ctx.update(context)

        if ids:
            ids = map(int, ids.split(','))

        id = (ids or False) and ids[0]

        if ids:
            return actions.execute_by_keyword(
                    name, adds=adds, model=model, id=id, ids=ids, context=ctx,
                    report_type='pdf')
        else:
            raise common.message(_("No record selected"))