Ajuda

0

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

Avatar
Mind And Go

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.

regards

2 Comentários
Avatar
Descartar
Avatar
Axel Mendoza
-

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.

Avatar
Mind And Go
-

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

3 Respostas
0
Avatar
Mind And Go
Melhor Resposta

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

Avatar
Descartar