Skip to Content
Menu
This question has been flagged
2 Replies
2379 Views

Hello

I want to create new users from my costume module, to realize that i have created a field which allows me to display or create users:

approved_by = fields.Many2one('res.users', 'Affecter à', default=lambda self: self.env.user)

But in the result it give me a page which contains only : Name, Email address, Phone, Fax and Mobile, 

Without the other informations.

Avatar
Discard
Best Answer

Hi Zakaria,

What you meant by getting  user registration menu in custom module ? If you want to get the same forms like one in the user creation, you just can copy the related views and menu action and just rename it with new ids. If you want to get the same then just give new menu in the custom modules actions as one in the original.

<menuitem id="new_menu_id" name="Menu Name" action="base.action_res_users" />
Avatar
Discard
Author Best Answer

Thank you so much Niyas :) it work !

How you can know the names of these actions ? Do you have documents which contain the names of the basic actions in Odoo.

Thank you :)

Avatar
Discard

To get the actions of each menu item , first we have to find the id of the corresponding menu. Id of the menu can be find out from , activate the developer mode first then go to settings -> Technical -> user interface -> menu items, then select the corresponding menu, then from the lady debug button near the logged in user you can select the view meta data, in that you can see xml ID, this will be the id of the menu , then searching this id in the pycharm we can see the menu as well as its action

Author

Thank you Niyas, you helped me really.

Can i ask you another question please. i want to display only my costume module in the top menu, and hidde the other modules ( like sales, web ..etc) is that possible?

How i can make to hidde menu of existing modul in odoo ..)

Either you can uninstall the modules, or you can hide it by like this, first go to settings -> users-> groups, then just create a new group named 'hide menus' or something . Then go back to settings -> technical -> user interface -> menu item , then select the menu to hide, then add this group for the menu. then do it for all the menus to hide , then just refresh and see

Author

Thank you again Niyas. I will try that. Just tell me pleas, when i have the id of the menu, how i will find the corresponding xml file which contain the id of the menu ? Thank you