Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is it possible to hide/disable Modules menu using a module?

By
malikge
on 3/12/14, 9:01 AM 1,855 views

Hi,

I am new to openERP and using v-7. I have created couple of modules.

I want to create a module to Hide or Disable Modules menu (and its sub-menu) from the left side.

Right now, this is showing in the Modules menu:

  • Modules
    • Installed Modules
    • Updates
    • Update Modules List
    • Apply Scheduled Upgrades
    • Apps

In /openerp/addons/web/static/src/xml/base.xml this is defined

<t t-name="Menu.secondary">
<div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id">
    <t t-foreach="menu.children" t-as="menu">
        <div class="oe_secondary_menu_section">
            <t t-esc="menu.name"/>
            <!--
                Shall the section be still clickable ?
                <t t-call="Menu.link"/>
            -->
        </div>
        <t t-call="Menu.secondary.submenu"/>
    </t>
</div>

</t>

How do I suppose to extend this in my module or is there any other way of doing this?

0

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 3/12/14, 9:25 PM

A menu is a standard document (database record) in OpenERP.

Create a new group called 'Nobody'.

Assign the menu to this group.

You can do this in a module by simply using XML to create the group and modify the groups of the menu.

<record id="<the XML ID of your new group>" model="res.groups">
    <field name="name">Nobody</field>
</record>

<record id="base.menu_management" model="ir.ui.menu">
    <!-- Use the `ref()` method to resolve the group XML ID -->
    <field name="groups_id" eval="[ref(<the XML ID of your new group>)]"/>
</record>

(Note the XML is from memory, so there could be minor typo's)

0

Med Said BARA

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
Med Said BARA
On 3/12/14, 9:25 AM

Hi;

You should take a look at the code HERE

My advice is, to never modify an existing module belonging to the core of OpenERP (openerp- server or openerp-addons) !!!

What you can do is, to create a new module (if possible) or at least to make your changes on an extra-module.

HERE you can find an example on how to make some changes on a module. (I've made those changes in order to fix a Bug, but the example is still valide in your case).

Fortunately, this example correspond exactly to your need.

You have to read the code carrefully, and try to understand how the actions are performed, and then make your own changes ... repeat ... and repeat ... again... and again ...

Make your changes only on the modules oerp_no_phoning_home and the web_hideleftmenu, don't modify the files in ..../openerp/addons/web/....

Link to oerp_no_phoning_home.

oerp_no_phoning_home and web_hideleftmenu are a good "place" where you can start learning how to achieve this task ...

If you succeed, then you can create your own module, Which can hide a part, or some parts of the menu, as you wish ...

good luck.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 3/12/14, 9:01 AM
Seen: 1855 times
Last updated: 3/16/15, 8:10 AM