Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
3653 Prikazi

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
Opusti

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.

Avtor

The error was : 

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

Related Posts Odgovori Prikazi Aktivnost
2
avg. 25
2502
3
feb. 25
3805
0
maj 24
46
1
apr. 24
3514
4
sep. 23
5056