Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3188 Widoki

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 ? 

Awatar
Odrzuć
Autor

yes i did but still not working

Autor Najlepsza odpowiedź

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)

Awatar
Odrzuć

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

Autor

yesi did but still not working

Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 24
1478
0
lip 24
1239
0
lis 23
1431
0
wrz 23
2060
1
lis 22
4139