Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2788 Vistas

I am copy/pasting this unanswered post from 2021:

"after creating a new test warehouse, couldn't delete the record with the following message popping up:


The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead.  

Model: Stock Rule (stock.rule), Constraint: stock_rule_picking_type_id_fkey 


Note: this a freshly created test warehouse with no record."


I am having the exact same issue, just created a test warehouse, did nothing else than trying to delete it and this message pops up. I am using odoo v16. How can we get clear of that constraint?

Thanks!


Avatar
Descartar
Mejor respuesta

Hi,

There is some records in stock.rule table in which this warehouse is used. If you need to delete the warehouse, first you need to delete records in stock.rule model of this warehouse.


Once the stock rules of this warehouse is deleted, you can delete this warehouse. Or you can consider, keeping the warehouse inactive instead of deleting.


Thanks

Avatar
Descartar

thanks Niyas, very helpful! Adding to this, hope it may come helpful, since I suffered from the same problem, I used manual query to check the 'stock_rule' table, since I already deleted from Rules view list but the constraint still persisted, then I witnessed that there still existed the data from the warehouses that I wanted to delete. I finally realized that I need to check for the Archived datas (inactive ones)