Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
1698 Visualizzazioni

Hello everyone,

I am trying to create a custom menu in Odoo 17, but despite multiple attempts, the menu does not appear in the interface. The menu I am creating is supposed to inherit from the om_hr_payroll module. Below are the details of my implementation:

  • The associated form view for the report.wizard model is defined like this:
<odoo>    
<record id="view_report_form" model="ir.ui.view">       
<field name="name">report.form</field>       
<field name="model">report.wizard</field>       
<field name="arch" type="xml">           
<form string="Générer Rapport">               
<group>                   
<field name="date_start"/>                   
<field name="date_end"/>               
</group>               
<footer>                   
<button string="Générer" type="object" name="generate_report" class="btn-primary"/>                   
<button string="Annuler" class="btn-secondary" special="cancel"/>          </footer>           
</form>       
</field>   
</record>
</odoo>
  • The action_report_excel is defined as follows:
 <record id="action_report_excel" model="ir.actions.act_window">                           
<field name="name">Rapport en Excel</field>       
<field name="res_model">report.wizard</field>       
<field name="view_mode">form</field>       
<field name="view_id" ref="view_report_form"/>       
<field name="target">new</field>   
</record>
  • I created a new menu item in my XML file as follows:
<odoo>
  <menuitem id="menu_custom_payroll" name="Rapport" parent="om_hr_payroll.menu_hr_payroll_root"/>   
<menuitem id="menu_report_excel" name="Rapport en Excel" parent="menu_custom_payroll" action="action_report_excel" sequence="50"/>
</odoo>


  1. I've updated the module, restarted Odoo, and activated developer mode.
  2. Checked the logs but found no critical error message.

Additional Information:

The new menu and sub-menu are supposed to inherit from the om_hr_payroll module under the root menu_hr_payroll_root. Despite following the steps above, the menu and sub-menu still do not appear.

What could be causing the menu not to display? Am I missing something in the configuration or setup? Any advice or pointers would be greatly appreciated!

Avatar
Abbandona
Risposta migliore

Hi,
Ensure menu record is created in the ir.ui.menu model and ensure an action is linked with the menu. If there is no action linked with menu the menu wont be shown in the UI, also ensure no user groups is assigned to the menu, if there is, ensure logged in user is part of the group. 


And of-course ensure all the files are imported in manifest and service is restarted

See:  https://www.youtube.com/watch?v=y8USDEpQvPM

Thanks

Avatar
Abbandona
Risposta migliore

Please check whether you have loaded the xml in manifest or not.

Also check it the menu is created in odoo by going in to the Menu Items master in odoo.

Avatar
Abbandona
Autore Risposta migliore

Ok thank you. The xml file is loaded on manifest. I will chech if the menu is on odoo techinical interface

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
nov 16
3577
2
lug 25
1523
1
mar 25
1104
1
dic 24
988
1
dic 24
1363