Skip to Content
Menu
This question has been flagged
1 Reply
517 Views
from odoo import models, fields


class patient_information(models.Model):
_name = "hospital.patient"
_description = "patient_information_Table"

name = fields.char(String="Patient_Name")
age = fields.char(string="Patient_age")
gender = fields.selection([('male', 'Male'), ('female', 'Female')], string="Gender")

i write the above code when i hove on char it pop up in pycharm that char function not in fields class.Also when i save and restart the service it give me an error of 500. 
i need your kind suggestions regarding this issue. Thanks in advance.



Avatar
Discard
Best Answer

Hi,

The fields.char has to be fields.Char and similarly for the selection field also.

C and S has to be Capital.

Thanks

Avatar
Discard