Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
3643 Näkymät

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
Hylkää

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.

Tekijä

The error was : 

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
elok. 25
2496
3
helmik. 25
3801
0
toukok. 24
46
1
huhtik. 24
3512
4
syysk. 23
5055