콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
47255 화면

I m trying to find a solution to give color to fields in form view. For now i have given color to the label .

But i also want to color the value that is there for that field.Is there any widget that i can use to get color or do i have to create a css for it.

아바타
취소

This Odoo app allows users to dynamically change the background and text color of any integer field based on a threshold value. The app introduces a customizable widget that automatically adjusts the visual representation of integer fields, allowing users to define their own colors for values below and above the threshold. Whether for financial figures, performance metrics, or other numeric values, users can easily tailor the display according to their preferences.
https://apps.odoo.com/apps/modules/17.0/mh_integer_field_color_widget

베스트 답변

You can just use inline css to get your goal
Like:

<field name="operator" style="background:Blue;" attrs="{'readonly':[('state', '=', 'done')]}"/>

if you need to give color for your letters, then use style="color:Red;" 

아바타
취소

Note: For W3C compliant CSS: If you define the color property, you must also define the background-color. I needed to do this with Odoo v11.

베스트 답변

If you want you color to depend from a color field, check out https://www.dator.lu/blog/blog-1/color-char-field-4

아바타
취소
베스트 답변

Hi ,

For that you need to create css and give the class name to the field.

ex: In Css file

.text_value_color {

    color: #052EF9;

}

In xml :

<field name="name" class="text_value_color"/>

아바타
취소
베스트 답변

It is a hint for you ?

https://www.odoo.com/forum/help-1/question/107387

아바타
취소
관련 게시물 답글 화면 활동
1
9월 22
7540
2
12월 23
12897
3
7월 22
23291
0
6월 22
2763
2
6월 21
18639