Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3629 Visualizzazioni

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
Abbandona

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.

Autore

The error was : 

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

Post correlati Risposte Visualizzazioni Attività
2
ago 25
2495
3
feb 25
3797
0
mag 24
46
1
apr 24
3512
4
set 23
5050