Skip to Content
Menú
This question has been flagged
1 Respondre
3313 Vistes

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
3
de maig 20
5002
3
d’oct. 20
5879