How to create / to hide a menu item in Odoo?

Hello everyone. Today, we will learn how to create menuitem in odoo using api8. Here we have an axample:

  • Create an xml file for your module.

menu

Make sure that the xml file is added to your __openerp__.py or __manifest__.py (for odoo10) for your module.

  • The sequence gives the order for your menu items (Settings menu got sequence 500, Reporting menu got sequence 170)
  • Action specifies the identifier of the action that must have been defined in the action table (ir.actions.act_window)
  • Groups specifies which group of user can see the menu item, you can also use it to manage the visibility for the menu item.

Hide a Menu item

Now we will learn how to hide a menu item, using xml. Here is a code example:

hide

There are 0 to 6 numbers for representing each job for a many2many / one2many field.

  • (0, 0, { values}) Link to a new record that needs to be created with the given values dictionary.
  • (1, ID, { values }) Update the linked record with id = ID.
  • (2, ID) Remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well).
  • (3, ID) Cut the link to the linked record with id = ID (delete the relationship between the two objects but does not dete the target object itself).
  • (4, ID) Link to existing record with id = ID (adds a relationship).
  • (5) Unlink all (like using (3, ID) for all linked records).
  • (6, 0, [IDs]) Replace the list of linked IDs(like using (5) then (4,ID) for each ID in the list of IDs).
Advertisements

One thought on “How to create / to hide a menu item in Odoo?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s