Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
3179 Переглядів

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
1476
0
лип. 24
1235
0
лист. 23
1428
0
вер. 23
2052
1
лист. 22
4137