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

I am trying to define a new field in read only mode, but it is not working:

<field name="sale_margin_percent" groups="base.group_user" attr="{'readonly': True}"/>

what is wrong with above definition? thanks

아바타
취소
베스트 답변

you can do readonly="1" without attr... attr is usefull if you want use a domain for conditional value...

아바타
취소
작성자

If I save the record, should readonly="1" fields be stored into database?

베스트 답변

You can use functional field for this purpose.

아바타
취소
작성자 베스트 답변

Using readonly="1" makes the user not being able to edit the field, but it is neither moved to database when you store the record.

Aa the field is updatd by onchange events, I would like to be able to avoid user modifying that field but at the same time moving the value back to database on save.

Any ideas?

아바타
취소

You can create a second field. First fiels are updated by onchange and invisible in form. Second fields is a related in readonly. Should works...

관련 게시물 답글 화면 활동
4
5월 23
10737
1
1월 19
9735
0
10월 17
3559
0
11월 16
2833
0
10월 16
5063