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

Hi,

I am trying to delete some record from database and I got an error .

How I can change it to DELETE with an SQL request?

 self.sudo().with_context(key='value').sudo(SUPERUSER_ID).unlink()


Thanks.

Avatar
Descartar

The error is usually to prevent you from leaving your database in an inconsistent state. Like not allowing you to delete a product you have already delivered. What is the error? Bypassing unlink with SQL delete is not recommend.

Autor

The error was : 

"Record does not exist or has been deleted.
(Records: account.payment(xxxxxx,), User: Y)"

Publicaciones relacionadas Respuestas Vistas Actividad
2
ago 25
2479
3
feb 25
3795
0
may 24
46
1
abr 24
3511
4
sept 23
5048