Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3185 Visualizzazioni

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
Abbandona
Autore

yes i did but still not working

Autore Risposta migliore

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
Abbandona

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

Autore

yesi did but still not working

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ott 24
1477
0
lug 24
1237
0
nov 23
1429
0
set 23
2057
1
nov 22
4138