Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
3196 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
окт. 24
1480
0
июл. 24
1245
0
нояб. 23
1440
0
сент. 23
2089
1
нояб. 22
4145