Selecting all records id's from Odoo Contacts listview
<p>I have written some python code in my .py file to display an wizard</p>

<pre><code>class DisplayWindow(models.Model):
_inherit = 'res.partner'
wizard_id = fields.Many2one('sale.example_wizard')

def result_to_search(self, cr, uid, active_ids):
    wizard = self.pool['sale.example_wizard'].create(cr, uid, vals={
        'partner_ids': [(6, 0, active_ids)]
    })
    return {
        'name': _('Account Search'),
        'type': 'ir.actions.act_window',
        'res_model': 'sale.example_wizard',
        'res_id': wizard,
        'view_type': 'form',
        'view_mode': 'form',
        'target': 'new',
    }
</code></pre>

<p>and here is my .xml file</p>

<pre><code>&lt;openerp&gt;
    &lt;data&gt;
        &lt;!--This xml file is responsible for the server action of displaying the wizard--&gt;
        &lt;record model="ir.actions.server" id="action_search_for_result"&gt;
            &lt;field name="name"&gt;Account Search&lt;/field&gt;
            &lt;field name="model_id" ref="sale.model_res_partner"/&gt;
            &lt;field name="code"&gt;
                if context.get('active_model') == 'res.partner' and context.get('active_ids'):
                    action = self.pool['res.partner'].result_to_search(cr, uid, context.get('active_ids'))
            &lt;/field&gt;
        &lt;/record&gt;
        &lt;record model="ir.values" id="search_result"&gt;
            &lt;field name="model_id" ref="sale.model_res_partner"/&gt;
            &lt;field name="name"&gt;Account Search&lt;/field&gt;
            &lt;field name="key2"&gt;client_action_multi&lt;/field&gt;
            &lt;!--automatically attach action to the dropdown button--&gt;
            &lt;field name="value" eval="'ir.actions.server,' +str(ref('action_search_for_result'))"/&gt;
            &lt;field name="key"&gt;action&lt;/field&gt;
            &lt;field name="model"&gt;res.partner&lt;/field&gt;
        &lt;/record&gt;
    &lt;/data&gt;
&lt;/openerp&gt;
</code></pre>

<p>My problem is that when I am selecting all customers from cutomers' listview it's only selecting first page contacts and whatever code I have written for wizard's button it's only working for that first page's customers.But my desired result suppose to work on all the customers which I have in database.
Probably I am doing something wrong with this piece of code </p>

<pre><code>wizard = self.pool['sale.example_wizard'].create(cr, uid, vals={
            'partner_ids': [(6, 0, active_ids)]
        })
</code></pre>

<p>Please help me. I can explain more if needed. Thanks</p>

<p>You can get selected record by using following code.</p>

<pre><code>wizard = self.pool['sale.example_wizard'].create(cr, uid, vals={
        'partner_ids': [(6, 0, self._context.get('active_ids',[]))]
    })
</code></pre>

<p>Thanks</p>

python xml listview odoo-9