تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3630 أدوات العرض

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.

الصورة الرمزية
إهمال

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.

الكاتب

The error was : 

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 25
2495
3
فبراير 25
3797
0
مايو 24
46
1
أبريل 24
3512
4
سبتمبر 23
5050