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

How to validate error message if some field is empty or uncheck etc ? is there any built-in function tag am using required in xml view but not working ? 

아바타
취소
작성자

yes i did but still not working

작성자 베스트 답변

I tried but not working am using on the xml?? 

from odoo import fields, models, api, _from odoo.exceptions import UserError
class SchoolProfile(models.Model):    _name = "school.profile"
    name = fields.Many2one("school.profile", string="School Name", required=True)

아바타
취소

did you upgrade the module after making the changes in xml?

작성자

yesi did but still not working

베스트 답변

Hi,

The following ways allow you to make a field required: either updating in Python or XML.

<field name="employee_id" required="1"/>

OR

employee_id = fields.Many2one('hr.employee', string='Employee', required=1)



https://www.youtube.com/watch?v=TR1TVykJmgE

아바타
취소
관련 게시물 답글 화면 활동
0
10월 24
1474
0
7월 24
1235
0
11월 23
1426
0
9월 23
2050
1
11월 22
4136