Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3192 Tampilan

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
Buang
Penulis

yes i did but still not working

Penulis Jawaban Terbai

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
Buang

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

Penulis

yesi did but still not working

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Okt 24
1480
0
Jul 24
1244
0
Nov 23
1438
0
Sep 23
2083
1
Nov 22
4141