Odoo Help

Welcome!

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

0

How to hide an act_window at the top menu without deleting it?

By
Juan Formoso
on 11/26/14, 6:56 AM 379 views

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"
     res_model="mail.compose.message"
     src_model="event.registration"
     view_mode="form"
     multi="True"
     target="new"
     id="act_invite_partner_to_event"/>

Can anyone help me, please?

0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 11/26/14, 7:18 AM

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[1] or False
    return {
                'type': 'ir.actions.act_window',
                'name': 'Some apropriate name',
                'res_model': 'your.model',
                'res_id': record_id, # if it is transient model first create record, othervise , provide some id
                'view_type': 'form',
                'view_mode': 'form',
                'view_id': view_id,
                'target': 'new',
                'nodestroy': True,
                }

 

Hope it helps... 

May the source be with you !

Thank you Bole! So, the only way to manage this is through Python, I didn't know that. Regards.

Juan Formoso
on 11/26/14, 7:33 AM

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/26/14, 6:56 AM
Seen: 379 times
Last updated: 3/16/15, 8:10 AM