Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3317 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
3
Mei 20
5025
3
Okt 20
5879