Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
231 Näkymät


I tired to install website_sale ,,,same popup Error
I tried to install stock_delivery ,,, same popup Error
I tried to create constraint in Technical,,,same popup  Error

Avatar
Hylkää
Paras vastaus

Hi,



The validation error appears because Odoo’s database integrity rules prevent the deletion of a record that is still being referenced in another model. In this case, the issue is related to the Product Moves (Stock Move Line) model and the carrier_id field, which is linked to a delivery carrier record. When Odoo detects that a stock move line is still referencing a delivery carrier that you are trying to delete or modify, it blocks the action to maintain data consistency.


This problem commonly occurs when you try to install or uninstall modules such as website_sale or stock_delivery, especially if some existing stock move lines still reference deleted or missing carrier records. It can also happen due to inconsistencies left behind during upgrades or partial uninstalls of delivery-related modules.


To resolve this, you should first avoid deleting carrier records that are still linked to stock move lines, archiving them is a safer option. You can also check and manually remove or update any stock move lines referencing carriers that no longer exist. If the problem is caused by outdated module definitions or missing relationships, upgrading the delivery and stock_delivery modules can help fix it. Running module updates using ./odoo-bin -u delivery,stock_delivery -d your_database_name will refresh database constraints and restore correct relationships.


If the issue persists, you can consider uninstalling and reinstalling the delivery modules, ensuring no dependent records remain. Lastly, if you have any custom modules modifying the carrier_id field, check that the field definition does not restrict deletions unnecessarily, changing the ondelete property to 'set null' might prevent similar errors in the future.

Check the methods in the testing environment first, and then in production.




Hope it helps

Avatar
Hylkää
Tekijä Paras vastaus

This worked!
Query:

UPDATE stock_picking

SET carrier_id = NULL

WHERE carrier_id IS NOT NULL;



Result:

UPDATE 2

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
helmik. 25
2719
2
helmik. 25
1929
2
maalisk. 25
7199
2
marrask. 24
2525
1
toukok. 24
2365