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.

2

How to change existing css creating a new module?

By
Alex
on 3/10/14, 1:31 PM 7,185 views

I don't want to modify the original one because I will lose the changes every time I update the module. Is that possible?

I cannot getting it works. Some explanation for dummies? :)

Thank you.

3
E.R. Spada II
On 11/1/14, 1:32 AM

Thanks to Jigar at Odoo,SA. In v8 you have to register the assets (css) in v8 with an xml file.

'name': 'Web Form Sheet Width',

'category': 'Hidden',

'version': '8.0.1.0',

'description':

"""

OpenERP Web core module.

========================

This module provides increase the sheet width in form

""",

'depends': [],

'auto_install': True,

'data' : ['ccoffee_page_view_width.xml'],

'js' : [

],

'qweb' : [

],

'test': [

],

}

xml file:

?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<template id="assets_backend" name="ccoffee_page_view_width assets" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

<link rel="stylesheet" href="/ccoffee_page_view_width/static/src/css/web_form_sheet_width.css"/>

</xpath>

</template>

</data>

</openerp>

THANKS!!!!!

Pascal Tremblay
on 12/26/14, 1:09 PM
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/10/14, 9:42 PM

Create a new module.

In your module's __openerp__.py file, you add a line:

'css': ['static/src/css/web_example.css'],

The trick is making sure you have the correct path matching the path where the existing CSS files are located.

Full documentation at https://doc.openerp.com/trunk/web/module/

Ok, no problem with openerp 7 but I can't change nothing in trunk version, so I think the problem is the new version. I was testing trunk version because I am interested in new POS. Do you know why?

Alex
on 3/12/14, 6:34 AM

Look an example: __openerp__.py

'depends': ['web'] 'css': ['static/src/css/web_example.css'],

OPENERP 7

web_example.css

.openerp .oe_menu &gt; li &gt; a {
    color: red;    
}

Change text menu color to red without problem

OPENERP 8 (TRUNK)

.openerp .navbar-nav &gt; li &gt; a {
    color: red;    
}

Nothing changes.

I am not a programmer and I am learning on the go but this is very disconcerting for me. I can't understand why. I have tried several css labels and I can't change nothing in trunk.

Alex
on 3/12/14, 6:54 AM

And what to do after changing these files? Odoo is not straightforward in this respect.

Kasper Souren
on 10/13/14, 6:21 PM

I am migrating v7 module that will increase web form width, the new file is under addons/web/static/src/css but it still will not update the form. The original file is base.css. Need to make the module change to this:.openerp .oe_form_sheet_width { min-width: 75%; max-width: 93%; margin: 0 auto; But I cannot get the path for v8 correct, anyone?

EUGE Consulting, E.R. Spada II
on 10/24/14, 11:55 AM

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

1 follower(s)

Stats

Asked: 3/10/14, 1:31 PM
Seen: 7185 times
Last updated: 6/16/16, 6:07 AM