Add sequence on menu-items


#1

I have added some menu items to the project menu structure. But now I want to move my menu item between “Projects” and “Tasks”. Normally you do that with the sequence="xx" on the menu item. However on the other menu items there is no sequence. How can I add the sequence to the other menu items within my own module?


(Sergi Almacellas Abellana) #2

If you are modifying the data via xml files of a external modules, you should reference the other modules xml id (using module.xml_id) and update the sequence.

Here is an example on how to update the sale and purchases menu:

<record model="ir.ui.menu" id="purchase.menu_purchase">
    <field name="sequence" eval="70"/>
</record>
<record model="ir.ui.menu" id="sale.menu_sale">
    <field name="sequence" eval="50"/>
</record>

The important part is that you set the same xml_id used on parent module and using modules name followed by a dot as prefix. This syntax is used by tryton to determine that you are referencing a record loaded from other module xml file.


#3

Ok, but in my case I had to deal with a <menuitem .../> . So I copied

<menuitem parent="menu_project_tree" 
    action="act_task_form" id="menu_task_form"/>

from the original module and changed it to:

<menuitem action="project.act_task_form" 
    id="project.menu_task_form" 
    sequence="40"/>

That worked.


(system) closed #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.