I've created an act_window. I've also created a button which calls this act_window. However, the act_window always appears at the top menu in the option More of the tree view of the source model. I want it to disappear, but I don't want to delete the act_window because it's called by my customized button.
<act_window name="Invite partner to an event"
Can anyone help me, please?
1. Delete the action , you dont need it
2. change button type from "action" to "object"
3. write a method that opens desired view like:
def open_my_view(self,cr, uid, ids, context=None):
view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'your_module_name', 'view_thate_should_be_opened')
view_id = view_ref and view_ref or False
'name': 'Some apropriate name',
'res_id': record_id, # if it is transient model first create record, othervise , provide some id
Hope it helps...
May the source be with you !
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 11/26/14, 6:56 AM|
|Seen: 353 times|
|Last updated: 3/16/15, 8:10 AM|