Hello community,
I created a production order relative to a BOM.
When I produce the order (any quantity) I got the following error message:
Cannot add or update a child row: a foreign key constraint fails (dolibar_spirits_database
.llx_mrp_production
, CONSTRAINT fk_mrp_production_stock_movement
FOREIGN KEY (fk_stock_movement
) REFERENCES llx_stock_mouvement_bak
(rowid
))
Can someone help me, please.
Thanks.
Making further checks I noticed that I have llx_stock_mouvement_bak
table other than than the llx_stock_mouvement
table. I don’t understand why it is referencing the bak table instead of the correct one.
Established that the working table is llx_stock_mouvement
, can I delete the bak to solve the issue?
[SOLVED]
Finally I found a solution. In phpmyadmin under the menu Structure->Relations view of the table llx_mrp_production I changed the field ‘Table’ relative to the foreign key fk_mrp_production_stock_movement from llx_stock_mouvement_bak to llx_stock_mouvement and it works well.