dolibarr
dolibarr copied to clipboard
Deleting a third party
Bug
One of our clients just told us about this bug in Dolibarr 16.0.5 :
- they created a new third party
- the new third party was defined as a "prospect / client"
- they added client tags to the third party
- they changed the third party as "neither prospect nor client"
- they tried to delete the third party → Cannot delete or update a parent row: a foreign key constraint fails (
cdcconseil_dolibarr
.llx_categorie_societe
, CONSTRAINTfk_categorie_societe_fk_soc
FOREIGN KEY (fk_soc
) REFERENCESllx_societe
(rowid
))
I think deleting the third party should first remove any tags the third party might have to avoid this issue.
In this particular case, the tags were still there but no longer displayed because the third party was no longer a prospect / client, which made it more difficult for the client to understand what was going on.
To perform the deletion, I simply changed back the third party to "prospect / client", removed the categories and then the deletion went smoothly, but this shouldn't be necessary.
Dolibarr Version
16.0.5
Environment PHP
7.4
Environment Database
MariaDB 10.11.16
Steps to reproduce the behavior and expected behavior
No response
Attached files
No response