Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Return tree view from wizard

By
code_shaman
on 2/12/13, 9:35 AM 1,011 views

Hi,

I'm trying to create a wizard which will analyze account.invoices and return some of them in a tree view. How do I return a new tree view with these ids i found from my wizard?

The code is executed, i see in the print out in the log.

This is how my code:

class wizard_find_credit_invoice(wizard.interface):

def _find_credit_invoice(self, cr, uid, data, context={}):
    print "gather invoices..."
    ... doing stuff...

    return {
            'domain': "[('id','in', [2995, 2994])]",
            'name': 'Invoices',
            'view_type': 'form',
            'view_mode': 'tree,form',
            'res_model': 'account.invoice',
            'view_id': False,
            'context': "{'type':'out_refund'}",
            'type': 'ir.actions.act_window'
    }

states = {
    'init': {
        'actions': [_find_credit_invoice],
        'result': {
                'type': 'action',
                'action': _find_credit_invoice,
                'state': 'end'
        }
    }
}
 wizard_find_credit_invoice('find_credit_invoice')

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/12/13, 9:35 AM
Seen: 1011 times
Last updated: 3/16/15, 8:10 AM