Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3318 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
mei 20
5025
3
okt. 20
5879