Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
4711 Vistas

I need XML file  for 

how I can inherit my new module from products to have all products features and add menu inside sales module in this structure::


sales - products -my_module 


Avatar
Descartar

How to create Action Menu in Odoo: https://goo.gl/UnHzS8

Mejor respuesta

Hi,

You can define a new menu inside your xml file like this,

<menuitem id="menu_test_translation_import"
name="Test translation import"
action="action_test_translation_import"
parent="menu_test_translation"/>

The above code will add a new menu under the specified parent menu, the parent for a menu is specified using the parent="" along with the menu item. Suppose of you need to add a new menu under and existing menu, first of all you have to get the external ID of the existing menu and then you can specify it as parent of newly creating menu.


To Get external ID of existing menu, see this: https://www.youtube.com/watch?v=rK5Qe8mA89Q

Then, you have to define the action for the menu, either you can create a new action or specify the existing action. For creating new action,

<record id="action_test_translation_import" model="ir.actions.act_window">
<field name="name">Test translation import</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">test.translation.import</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="target">current</field>
</record>


Suppose if you need to use any existing action, you can do that too by the external id, suppose if you need to show products on clicking your menu, you can use the action given for the product menu, to get the ID of the action, activate the developer mode, navigate to Settings -> Technical -> User Interface -> Menu Items, search for product menu and open it, now you can see a field named Action, click the record and open it and get external id from there as shown in video.

Then specify it in your menu in actions=""


If you are new to Odoo and like to learn Odoo development , see this: https://www.youtube.com/watch?v=Tdg4YQowXyI&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM&index=3


Thanks

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
ene 24
6529
2
ene 23
3210
1
feb 22
2165
5
abr 25
1950
1
mar 24
3591