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

i have an integer field and put the required condition so : [["category_id","in",[2]]], but in can let the integer field to 0 : it is accepted

with required condition on in text (char) field : [["category_id","in",[2]]]  : the field is really required when the condition is met

can you help please ?

Thanks

Denis

아바타
취소
작성자

thanks but i am looking for a solution within Studio, not with a purchase of an external module.

베스트 답변

Hello Henkens Denis,

Please find below code it may help you to resolve this issue.

Please find Example in comment. 

I hope this can help you.

Thanks & Regards,
Email:   odoo@aktivsoftware.com 

Skype: kalpeshmaheshwari

아바타
취소

Please find code here :-

For integer field required, you need to add integer field in your object, and set the required parameter in field.

Py file code:

field_name = fields.Integer(string="Field Name" required=True)
when you are required integer field by py file, that field required in database and view both side.

xml file code:

<field name="field_name" required=1/>
when you are required integer field by xml file, that field required only for view not database.

Hi Jainesh, The idea that you are presenting is very basic for other datatype fields. However, It will not work if Integer and Float fields are required while saving records.