Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
784 Tampilan

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?

Avatar
Buang
Penulis Jawaban Terbai

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')
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Des 18
5182
0
Jun 21
6367
1
Nov 22
5636
1
Okt 21
3300
2
Nov 18
10204