Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
1698 Представления

Hello everyone,

I’m currently facing an issue in Odoo CRM. I have a many2one field called stage_id in the crm.lead model, which is linked to the crm.stage model. I want to delete a specific stage from the crm.stage model as it is no longer needed. However, when I try to delete it, I encounter the following error:

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

Model: Lead/Opportunity (crm.lead)

Constraint: crm_lead_stage_id_fkey

I’ve checked, and there are no leads currently using this stage (active or archived). I’ve also verified that the stage isn’t set as the default in any pipeline or automation rules.

Has anyone encountered this issue before? Is there a way to resolve it without breaking database integrity? Any advice or guidance would be greatly appreciated!

Thank you! 😊

Аватар
Отменить

I'm currently facing the same issue :)

Лучший ответ

Hi,


In Odoo CRM, the error you’re seeing when trying to delete a stage (crm.stage) comes from a foreign key constraint (crm_lead_stage_id_fkey), meaning at least one record still references that stage. This can happen even if no active leads use it, since archived leads, sales teams (pipelines), or default configurations may still link to it. To resolve, you should first search for all leads including archived ones, check sales teams to see if the stage is still assigned, and confirm it isn’t set as a default. The safest practice is to archive the stage instead of deleting it, especially in production, to preserve database integrity and historical data. Deletion should only be done if you’re absolutely sure nothing references it.


Hope it helps

Аватар
Отменить
Лучший ответ

Facing the same issue here.

Аватар
Отменить
Лучший ответ

Since the stage_id​ field from crm.stage​ is also linked to the crm.activity.report​ model, it is likely that this connection is preventing you from deleting the stage directly. The foreign key constraint enforces that no crm.activity.report​ records are referencing the stage you are trying to delete.

Аватар
Отменить
Автор

Thank you for responding, I checked the 'crm.activity.report' model and there was nothing referencing this stage.

Related Posts Ответы Просмотры Активность
2
авг. 25
1611
1
сент. 24
1849
1
июн. 22
3509
0
сент. 17
3560
1
сент. 16
5379