Odoo Help

2

0
4 Answers
2
vital_zaq6 Moldavia
12/3/13, 6:28 AM

i find way to set color on load by extending js

is it right way ?

var apply_theme = function(instance)
{
    if(instance)
    {
        new instance.web.Model('res.users')
            .query(['name','company_id'])
            .filter([['id', '=', instance.session.user_context.uid]])
            .first()
            .then(function (user) {
                if(user)
                {
                    new instance.web.Model('res.company')
                        .query(['name','theme_color_menu_back'])
                        .filter([['id', '=', user.company_id[0]]])
                        .first()
                        .then(function (company) {
                            if(company)
                                if(company.theme_color_menu_back)
                                    $('td.oe_topbar').css('background', company.theme_color_menu_back);
                        });
                }
            });
    };
}

openerp.my_base_ext = function(instance){

    var module = instance.web; // loading the namespace

    module.UserMenu.include({

        start: function() {
            this._super();

            apply_theme(instance);
        }

    });
};
1
martinien olinga Cameroon
12/17/13, 3:40 AM

I created a openerp 7 module which allows you to choose templates : www.martinienolinga.com/en/plugin-des-templates-sous-openerp, You can look at source code how to do what you want

0
Avatar

IT Libertas Russian Federation

--IT Libertas--
1258
| 4 3 9
Saint Petersburg, Russian Federation
--IT Libertas--

Visit us: https://odootools.com/

IT Libertas is a team of developers and automation experts to help you to unlock Odoo ERP system's potential. We have been communicating with end users to whom the software became a main business tool since 2012. As a result, we are proud of dozens of successful Odoo apps developed.

We are open for new ideas and challenges to create the best Odoo tools for business needs all over the world

IT Libertas Russian Federation
3/24/16, 1:06 PM

You may have different styles by different users (including users from various companies) just by installing this module: https://apps.odoo.com/apps/modules/8.0/colors_customization/

Ask a Question
Writer
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