How to call a Python function from an act_window in OpenERP7?



I added a new option to the menu More, at the top side of the screen (tree view). To do that, I did an act_window in XML:



<act_window name="Invite partners to an event"
res_model="mail.compose.message"
src_model="event.registration"
view_mode="form"
multi="True"
target="new"
id="invite_partner_to_event"/>


Everything works OK, I can select rows of the tree view of event.registration, click on More, and mi option Invite partners to an event appears. When I click on this, the form view of the model mail.compose.message is opened in a pop-up, which is exactly what I want.


Now my problem: I'd like to perform a Python function when I click on my option, (and the user mustn't notice that). I.E.: the user won't be able to feel the difference, but I will be modifying several things in the backend through that function.


¿How could I manage this? Thank you in advance.


No comments:

Post a Comment