Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
3628 Vues

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
Ignorer

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.

Auteur

The error was : 

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

Publications associées Réponses Vues Activité
2
août 25
2495
3
févr. 25
3797
0
mai 24
46
1
avr. 24
3512
4
sept. 23
5050