Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
156 Vistas

I'm having an issue deleting a website within odoo.
I have changed the website.default_website so that the record ID is referencing the new website, however when I attempt to delete the original website, it returns an error:

Validation Error

The operation cannot be completed: Another model requires the record being deleted, if possible, archive it instead. Model: 'Pricelist' (product.pricelist) Foreign key: 'Website' (website_id)

I don't have an archive option in the actions menu
Is someone able to assist with this issue?

(As I have only just started on my odoo journey and am not transacting within it yet, i'm not against starting a whole new database, if I need to)

Avatar
Descartar
Mejor respuesta

Hi,


In Odoo, you cannot delete a website directly if other records depend on it, because the website is linked to models like pricelists, menus, and pages through foreign keys. That’s why you see the validation error about the pricelist requiring the website. The cleanest approach is usually to archive the old website instead of deleting it. Every website record has an active field, so when you archive it (set active=False), the website is hidden but all dependencies remain safe. You can do this by enabling Developer Mode, opening the old website from Website → Configuration → Websites, and choosing the Archive option from the action menu. If you really want to delete the website, you must first reassign or clear all dependencies—for example, open Website → Configuration → Pricelists, and either remove the old website reference or point them to your new website. Once nothing references the website, deletion is possible. A third, more technical option is a hard delete by running SQL to clear all foreign key references and then remove the website record, but this is not recommended outside of a test database because it can break your system. Since you mentioned you’re just starting and not transacting yet, the simplest and safest option is to either archive the old website or create a fresh database with only the website you want. This gives you a clean slate and avoids the risk of breaking dependencies.



Hope it helps



Avatar
Descartar
Mejor respuesta

Hello!

The problem is that Pricelist referencing this website exsist, so you must do something with it. You can either delete it or attach to other Website, depending on your needs. To do that:

  • Go to Website > eCommerce > Pricelists
  • Update every Pricelist that point to the website you want to delete (change Pricelist Website to other one, or delete Pricelist)

That should fix the issue.

Best Regards
Dawid Gacek, adapt-it.pl

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
sept 21
3379
1
sept 25
231
5
ago 25
4811
2
ago 25
1492
2
ago 25
719