Skip to Content
मेन्यू
This question has been flagged
1 Reply
3316 Views

I have this issue with the res.partner model.

The code:
`
class Patient(models.Model):
​_inherit='res.partner'
​_description='Laboratory Patient'
​patient_name=fields.Char(string='Patient Name',help='Name of the patient',required=True)
​gender_id=fields.Many2one('laboratory.genders',string='Patient Gender',required=True,)`

The error:

2023-04-15 00:34:56,456 205456 ERROR lims_empty odoo.schema: Table 'res_partner': unable to set NOT NULL on column 'gender_id' 
2023-04-15 00:34:56,459 205456 ERROR lims_empty odoo.schema: Table 'res_partner': unable to set NOT NULL on column 'patient_name' 


Avatar
Discard
Best Answer

Hi,

I hope this is just a warning in the log file, what it says is that, when you add a new field with required attribute as True, there is some existing data in the db for which this field value is null. So if you set the values for those records in the newly added required field, you wont get this message in the log.


Thanks

Avatar
Discard
Related Posts Replies Views Activity
3
मई 20
5020
3
अक्तू॰ 20
5879