[17.0] account_edi_format: psycopg2.errors.ForeignKeyViolation: update or delete on table "account_edi_format" violates foreign key constraint "account_edi_document_edi_format_id_fkey" on table "account_edi_document"
I'm on de83b78992af159b41786806966ccde8e21175da and verified this code is included. It seems that this commit actually triggers the error since it tries to delete the entries from account_edi_format while those records are still being referenced in account_edi_document.
I might misinterpret things here.
Also checked https://github.com/OCA/openupgradelib/pull/279/commits/860a5b11acc5d984d64049a0a429d4dfcc897e2f where the delete_records_safely_by_xml_id function is defined. I don't see how having this would resolve the references in the account_edi_document table. Should/could these account_edi_document entries be deleted and will they be created in another table? It's unclear what the proper way forward is.
Originally posted by @th3penguinwhisperer in #5046
My issue got closed while I'm on the commit that should resolve this...
That code should handle it, as not being able to remove the record, the XML-ID is marked as noupdate for not being automatically removed.
That code should handle it, as not being able to remove the record, the XML-ID is marked as noupdate for not being automatically removed.
Not sure I read this right. Might be lost in translation. So it intentionally fails and the action to be taken is deleting these records manually?
No, as said, the code already tries to delete it, and if not able, mark the XML-ID as noupdate=1 for not being removed.