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.

7

How to add submenu to "More" button on form view

By
kalmenchia
on 5/20/13, 5:33 AM 14,366 views

Hi ,

Would like to find out , if i have a form view and tree view , e.g. Product form view , if we click the existing "More" button there are submenu such as Inventory moves , future Stock moves etc

how can i add "my dialog"(a new submenu) to the "More" button ? ( the new submenu will call another wizard )

Thank you, this help me a lot !

Sody
on 3/4/15, 9:15 AM
10

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 5/20/13, 5:39 AM

Hi ,

use key2="client_action_multi" in act_window to add submenu to "More" button .

<act_window name="New Sub menu"
    res_model="product.product"
    src_model="product.product"
    key2="client_action_multi" 
    view_mode="form" target="new" 
    view_type="form"
    id="act_new_sub_menu" />

see doc openerp Action creation.

and Linking events to action

4
kalmenchia
On 5/20/13, 6:23 AM

thanks Borni ,

but that is not very clear , i solved myself , here is the summary,

   <record id="action_asset_contract_prn_contract" model="ir.actions.act_window">
        <field name="name">Print Contract</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">asset.print.contract</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_asset_contract_prn_contract"/>
        <field name="target">new</field>
        <!--field name="multi">True</field-->
    </record>

where res_model = asset.print.contract is my form /wizard .

  1. Regarding the code you used for the 3 records, I have tried to remove "<field name="multi">True</field>" on the 2nd record, and then reinstall the module, the "print contract" immediately appears on both form and tree.

  2. To control the new function to appear on either "Print" or "More", change the "key2" part, where "client_action_multi" will make the function to show in "more", and "client_print_multi" will make the function to show in "print".

excellent!

Group ODOO
on 10/2/13, 7:00 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

6 follower(s)

Stats

Asked: 5/20/13, 5:33 AM
Seen: 14366 times
Last updated: 11/18/16, 3:44 AM