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

Version: Odoo 13

Note: I am new to Odoo and it is possible that I am might be missing something obvious.

In a model form view I am using html field and I want to make it mandatory. I used required=True flag on python and also required="1" in xml but none helped.

in python:

rich_text = fields.Html('Field Name', required=True)

in xml: (form view)

<field name="rich_text" widget="html" required="1"/>


Any help is much appreciated. Thanks.

아바타
취소
작성자

@Keval Mehta, I installed Lunch app and tested 'lunch alert' view with Html field. Though it is defined as required I am able to create alerts without that field.

Try adding required via css

베스트 답변

Your define argument : 

rich_text = fields.Html('Field Name', required=True)

should be work as if you see in default odoo13 base you will find : 

message = fields.Html('Message', required=True) under ​addons/lunch/models/lunch_alert.py file. 

아바타
취소
관련 게시물 답글 화면 활동
3
5월 25
2141
1
4월 25
1642
3
9월 24
14750
2
2월 24
2729
1
7월 23
2957