Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
3190 Visninger

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 ? 

Avatar
Kassér
Forfatter

yes i did but still not working

Forfatter Bedste svar

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)

Avatar
Kassér

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

Forfatter

yesi did but still not working

Bedste svar

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

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
okt. 24
1479
0
jul. 24
1241
0
nov. 23
1435
0
sep. 23
2081
1
nov. 22
4141