Hello. I was wondering how can you run a function when you click on an option from the "More" menu dropdown in a Tree view.
For example: When you are looking at all the records in a Tree view, then you click the check box for each record, then the "More" button appears at the top and if you select "Delete" then it calls the unlink method for that model and deletes the selected records.
I figured out how to add another item in the "More" dropdown, but I don't know how to run a function when the item is clicked. All it does right now is open another form view, but I would like it to process some information before displaying it in another form. Here is an example of what I have
<record id="hr_employee_normal_action_tree2" model="ir.actions.act_window">
<field name="name">Erics More Item</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.employee</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record model="ir.values" id="test_more_item">
<field name="name">Test Item</field>
<field name="model" eval="'sale.order'" />
<field name="key" >action</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,%d'%hr_employee_normal_action_tree2" />
<field name="object" eval="True" />
</record>
So does anyone know how to run a function when the item from the "More" dropdown is selected? I guess what I kind of need is the functionality which is similar to a button that is an object type. So when a button is clicked then it runs a function on that model.