Odoo Help

5

1
3 Answers
1
Francisco Luz Brazil
7/2/14, 12:29 PM

Aside from Taferner's CSS solution, which by the way is a great valid solution, I am aware of another 2 ways of doing it.

1st Option: Override the html:

* Create a new module
* In your module's manifest ( __openerp__.py ). Add the following:

'qweb': [
        "static/src/xml/*.xml",
 ],

* Create a xml file at static/src/xml/web_custom.xml
* Inside web_custom.xml. Add the following:

<?xml version="1.0" encoding="UTF-8"?>
<templates>
    <t t-extend="WebClient">
        <t t-jquery="td.announcement_bar" t-operation="replace">
          <div class="announcement_bar">
            <span>You have conquered this spot.</span>
          </div>
        </t>
    </t>
</templates>

 

2nd Option: Override the Javascript:

* Create a new module
* In your module's manifest ( __openerp__.py ). Add the following:

'js': [
        "static/src/js/*.js",
],

* Create a js file at static/src/js/announcement_bar.js
* Inside announcement_bar.js. Add the following:

openerp.MY_MODULE_NAME = function(instance) {
    instance.web.WebClient.include({
        // Remove annoucement_bar.
        show_annoucement_bar: function() {
            return;
        }
    });
};

 

1
Avatar

Wolfgang Taferner Austria

--Wolfgang Taferner--
8102
| 4 3 7
Wien, Austria
--Wolfgang Taferner--
Wolfgang Taferner Austria
1/20/14, 2:38 AM

Hi Wilson Andres,

You can easily hide it in customizing CSS of your own module or any module in your instance (you can add it most of the times in this file: static/src/css/base.css)

 .openerp .announcement_bar {
    display: none;
    visibility: hidden;
 }

One little and effective customization for not going crazy ;-)

Good luck and have fun.

-1
Lithin T United Arab Emirates
7/2/14, 4:30 PM

Another crazy and easy way to remove the announcement bar is
comment the line

openerp_announcement(session); 

in addons/mail/static/src/js/mail.js

Sample:

openerp_announcement(session);  

to

//openerp_announcement(session); 

2 Comments
Francisco Luz Brazil
7/2/14, 7:20 PM

Hacking into core code is a terrible idea.

Francisco Luz Brazil
7/2/14, 7:21 PM

You should always implement changes in custom modules.

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now