Odoo Help


action server multi checkbox select

on 12/13/13, 8:55 AM 4,581 views

Hello I'm trying to develop a ir.actions.server in a custom tree view. When I select some checkbox (the typical checkbox that it appears at first position in a tree) and I click in the button that I created, it always executes my code in the first item, not in all rows that I selected... How I can tell to OpenERP that it has to do it in all rows I selected?

This is my xml <record id="action_sale_order_liquidar" model="ir.actions.server"> <field name="name">Liquidar</field> <field name="type">ir.actions.server</field> <field name="model_id" ref="model_sale_order"/> <field name="state">code</field> <field name="code">obj.button_add_field(context=context)</field>

    <record id="id_of_the_action_value" model="ir.values">
        <field name="name">Liquidar</field>
        <field name="action_id" ref="action_sale_order_liquidar"/>
        <field name="value" eval="'ir.actions.server,' + str(ref('action_sale_order_liquidar'))"/>
        <field name="key">action</field>
        <field name="model_id" ref="model_sale_order"/>
        <field name="model">sale.order</field>
        <field name="key2">client_action_multi</field>


and this my py; def button_add_field(self, cursor, uid, ids, context): for i in ids:
cursor.execute("UPDATE sale_order SET estado1='complete' WHERE id = "+str(i)) return True

Thanks in advance

On 12/13/13, 9:34 AM

I found the problem, I have to change this line: <field name="code">obj.button_add_field(context=context)</field> to <field name="code">self.function_to_run(cr, uid, context.get('active_ids'), context=context)</field>

where function_to_run is the function which openerp will call

Hi victor, can I ask if this is for the confirmation of more than one sales order at a time?

on 12/13/13, 9:55 AM

Were you able to open the sale order form after the function was ran? I am having this problem now where the form doesn't open after the function is ran

on 9/4/14, 3:40 PM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/13/13, 8:55 AM
Seen: 4581 times
Last updated: 3/29/16, 8:56 AM