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>
<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>
</record>
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