I have a field of type many2one
. Also in my database I have many records.
So right now I want to change the type of this field from many2one
to many2many
, but when I create a record it shows me an Integrity Error
.
This is my field:
bed_id = fields.Many2one('i.bed', 'bed', required=True, ondelete="restrict", track_visibility="onchange")
And I was change it to this:
bed_id = fields.Many2many('i.bed', 'bed', required=True,string="beds", track_visibility="onchange")
The Integrity Error is:
The operation cannot be completed, probably due to the following: - deletion: you may be trying to delete a record while other records still reference it - creation/update: a mandatory field is not correctly set
[object with reference: bed_id - bed.id]
How can I fix that without deleting the existing records in my database?