Odoo Help


[IMP][FEATURE]How to style conditionnaly some fields in forms / Qweb in forms

Mind And Go
on 7/8/15, 10:54 AM 1,228 views

Hi everyone,

I've been looking for the best way to use Qweb in forms views because it seems to be the answer to my problem. Unfortunately, IRC and the forum seems to be agree on the fact that it's not possible in form view. So here is a wish!

Anyway, I need a work around for this styling part. I would like to color a field (membership_state) thanks to style, css or whatever regarding to its value.

Any advice would be appreciated.


Here are some ideas: 1- Declare your field with a class attribute with your css class name. Then in a css style the field as you need 2- (if #1 doesn't work) Declare your field inside a div and add a class to the div with your css class name. Then in a css style the field inside the div as you need 3- if nothing above works then you need to extends the used widget in javascript to process an option that have the color that you need to apply or the class for the field style. Use include to replace normally the start function.

Axel Mendoza
on 7/14/15, 3:56 AM

Hy @Axel, thanks for the answer, actually it wasn't reaaly what I'm looking for. Styling through css the field with class attribute works well but my point is to **conditionnaly** style the object. In the end, I think I'll have to do some fileds_view_get. regards

Mind & Go, Mind And Go
on 7/14/15, 4:14 AM
Mind And Go
On 7/19/15, 6:30 AM

I think it could be consider as a feature request : https://github.com/odoo/odoo/issues/7526

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.


Odoo Training Center

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

Test it now

Question tools

1 follower(s)


Asked: 7/8/15, 10:54 AM
Seen: 1228 times
Last updated: 7/19/15, 6:31 AM