Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3315 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
kvě 20
5016
3
říj 20
5879