This question has been flagged
1 Reply
4885 Views

Hi folks,

I am in the process of re-skinning version 7 for our CRM system. This involves a lot of custom CSS to override the existing colour system, but I also want to add some new images for use as backgrounds.

So, what I have in my __openerp__.py file:

    'images' : [
        'images/my_image.jpeg',
    ],
    'css': ['static/src/css/my.css'],

And then in my.css I have the following:

.openerp .oe_application .oe_form_sheetbg {
    background: url("images/my_image.jpeg") repeat scroll 0 0 transparent;
}

My question is what is the proper path to access my image? images/my_image.jpeg doesn't work and I've tried a few other variations too.

Many thanks in advance, and also a big thank you to the OpenERP team for allowing us to use custom CSS in the modules! It has always been a bit of a pain for us in the past as most of our customers want different skins on OpenERP and it became hard for us to source control each skin as we wanted the web client separate from client skins. This new system makes it soooo much easier!

Avatar
Discard
Author Best Answer

Right, sort of managed to solve the problem.

I have moved the image I want to use in to static/src/img directory. From there, I can reference it from the CSS in the following way:

.openerp .oe_application .oe_form_sheetbg {
    background: url("../my_image.jpg");
}

It seems that the images only work if placed within the static directory, as soon as you place them outside this directory the CSS is unable to find them. Also, listing the image within the images section of __openerp__.py seems to make absolutely no difference to the CSS. So, I'm a little confused but at least I have a working solution for now.

I suspect that the images section is probably used for setting icons on buttons/menu items etc.

Avatar
Discard