This question has been flagged
6427 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')
Avatar
Discard