Geraldine M
Geraldine M

Reputation: 3

Odoo 12 : Change the name of the menuitem of an inherited view

I want to change the name of a menuitem( All timesheets to All activities) by view inheritance but it doesn't work.

This is original menu

<menuitem id="timesheet_menu_activity_all"
           name="All Timesheets"
           parent="menu_hr_time_tracking"
           action="timesheet_action_all"/>

another one is a new menu

 <menuitem id="hr_timesheet.timesheet_menu_activity_all"
            name="All Activities"
            parent="hr_timesheet.menu_hr_time_tracking"
            action="hr_timesheet.timesheet_action_all"/>

Upvotes: 0

Views: 1083

Answers (1)

Dipen Shah
Dipen Shah

Reputation: 2444

Please use this code to change the name of existing menu Item name.

<record model="ir.ui.menu" id="hr_timesheet.timesheet_menu_activity_all">
    <field name='name'>All Activities</field>
</record>

The menu entries are stored as records of the 'ir.ui.menu' object type, so it is possible to use 'record' XML tags to update 'ir.ui.menu' records by providing 'model' and 'id' attributes to identify the existing record.

Thanks

Upvotes: 1

Related Questions