When I try to update a field before raising a UserError, the value doesn't get saved to the database. How can I ensure the field is saved even before the UserError is raised?
لقد تم الإبلاغ عن هذا السؤال
1
الرد
2517
أدوات العرض
We can use
self.env.cr.commit()
just before the UserError() to save the values.
Eg:
self.env.cr.commit()
raise UserError('Some issue has been occured')
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل| المنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
|---|---|---|---|---|
|
|
1
ديسمبر 18
|
7058 | ||
|
|
0
يونيو 21
|
8128 | ||
|
|
1
نوفمبر 22
|
10150 | ||
|
|
1
أكتوبر 21
|
5814 | ||
|
|
2
نوفمبر 18
|
13024 |